From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Fri Sep 15 2006 - 23:34:41 CDT

On Fri, 15 Sep 2006 tnels_at_sfu.ca wrote:

TN> Hi,
TN>
TN> I need to call VMD in text mode using the UNIX command line as follows:
TN>
TN> $ vmd -dispdev text -e vmd_calls.txt -args "residue 5" backbone 0 1000 out_file
TN>
TN> the problem is that VMD won't accept the double quotes in this call.  My question is, can I
TN> pass a string containing spaces into -args as a single argument somehow?  I have tried
TN> several things like braces and backslash with no success.

hi,

the problem is in the csh code of the vmd script
and in part even in a deficiency of csh.

the argv subscript error you can fix by loading the
vmd script into a text editor. look for

foreach i ( $* )

around line 140, and replace it with

while ( $parmcount < $#argv )

however this does not fix the problem of
the final $* splitting the argv array
at every blank. this can be only fixed with
rewriting the vmd script in bourne shell
and using "$@" instead of $* .

however you can still pass the string you want selectively
be using the generic environment pasing.

e.g. by starting VMD with

env VMDARGS='text with blanks' vmd -dispdev text -args what ever

and then refer to the variable with blanks via:

$env(VMDARGS)

cheers,
   axel.

TN>
TN> thank you
TN>
TN>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.