* 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'
> > > works.
> > 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://18.104.22.168: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
/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.