Many thanks for all answers, it is greatly appreciated.
Best wishes,
Thomas
On Thu, Apr 29, 2010 at 09:50, Ian Tickle <[log in to unmask]> wrote:
> On Thu, Apr 29, 2010 at 4:25 PM, Edward A. Berry <[log in to unmask]> wrote:
>> Command-line param like XYZIN don't seem to be shell variables,
>> but can be set by variables:
>>
>> bin/ncont XYZIN $XYZIN <<eof>ncont${XYZIN}.log
>
> Actually command line parameters for CCP4 programs are indeed also
> shell variables, though they first have to be exported to the
> environment so they can be picked up by the program.
>
> So for example:
>
> setenv XYZIN input.pdb
> setenv XYZOUT output.pdb
> program_name <<EOF
> ..
> EOF
>
> produces exactly the same result as:
>
> program_name XYZIN input.pdb XYZOUT output.pdb <<EOF
> ..
> EOF
>
> If the variable is specified both in the environment and on the
> command line, then the latter is always used. What happens is that
> when say 'XYZIN input.pdb' is read from the command line (or it could
> be from anywhere), the function that processes the command line does
> an internal 'setenv XYZIN input.pdb' (thus overwriting any previous
> setting of XYZIN). Then whenever the value of the XYZIN variable is
> needed, say to open a file, the value is read back from the
> environment by the file-opening function.
>
> -- Ian
>
|