I believe the intent of the (test...) was to see if a .profile existed and execute that if so. This was at the request of users who complained that their remote environment wasn't being setup as expected when we launched their jobs. Might be a better way to do it, though...
On May 3, 2010, at 12:13 PM, Ralf Wildenhues wrote:
> * Jeff Squyres wrote on Mon, May 03, 2010 at 04:04:59PM CEST:
>>> On Apr 29, 2010, at 11:24 AM, Jonathan Vincent wrote:
>>>> sh -c '/usr/bin/env FOO=bar (echo hello)'
>>>> ksh -c '/usr/bin/env FOO=bar (echo hello)'
>>>> is not valid
>>>> sh -c '/usr/bin/env FOO=bar echo hello'
>>> Per your later mails, plm_rsh_module.c does this:
>>> tmp = opal_argv_split("( test ! -r ./.profile || . ./.profile;", ' ');
>>> (and later adds the closing ")"). You reported the final line to be:
>>> /usr/bin/env LD_LIBRARY_PATH=/pdc/vol/openmpi/1.4.1/intel/lib:/pdc/vol/icompilers/11.1/icc/lib/intel64:/pdc/vol/i-compilers/11.1/ifort/lib/intel64 ( test ! -r ./.profile || . ./.profile; /pdc/vol/openmpi/1.4.1/intel/bin/orted -mca ess env -mca orte_ess_jobid 284360704 -mca orte_ess_vpid 3 -mca orte_ess_num_procs 5 --hnp-uri "284360704.0;tcp://184.108.40.206:49530" )
>>> What would the correct syntax be?
> Well, after the arguments setting the variables, portable env really
> only takes a command line with arguments, not something that is passed
> to the shell again. You could work around this by constructing
> something like
> /usr/bin/env var=val ... sh -c 'script ...'
>>> With the || and ;, are the () really unnecessary?
> Well, neither the () nor the || nor ; really belong in a command-line
> that is not interpreted by a shell.
> devel mailing list