M
Mark Bergman
We have inherited a script which runs rsh (remote shell), taking
parameters from a variable, and if attempting to run a multi-word
command remotely, we get an error!
See the example below which shows 3 variations - the middle gives an
error:
============
n2:/tmp} cat remscript
echo "try rsh for uname (as part of variable)"
c=" n1 -l scada 'uname'"
rsh $c
echo "try rsh for uname -a (as part of variable)"
c=" n1 -l scada 'uname -a'"
rsh $c
echo "try rsh for uname -a (not as part of variable)"
rsh n1 -l scada 'uname -a'
n2:/tmp} ./remscript
try rsh for uname (as part of variable)
OSF1
try rsh for uname -a (as part of variable)
ksh: uname -a: not found
try rsh for uname -a (not as part of variable)
OSF1 n1 V4.0 1229 alpha
==============
It's not just "uname -a" - any multi-word command gives the problem.
I've tested this on Linux and on Digital Unix.
I imagine it's something to do with the quotes, but I can't figure it
out!
TIA
Mark Bergman
Manchester UK
mark . bergman @ thales - is . com
parameters from a variable, and if attempting to run a multi-word
command remotely, we get an error!
See the example below which shows 3 variations - the middle gives an
error:
============
n2:/tmp} cat remscript
echo "try rsh for uname (as part of variable)"
c=" n1 -l scada 'uname'"
rsh $c
echo "try rsh for uname -a (as part of variable)"
c=" n1 -l scada 'uname -a'"
rsh $c
echo "try rsh for uname -a (not as part of variable)"
rsh n1 -l scada 'uname -a'
n2:/tmp} ./remscript
try rsh for uname (as part of variable)
OSF1
try rsh for uname -a (as part of variable)
ksh: uname -a: not found
try rsh for uname -a (not as part of variable)
OSF1 n1 V4.0 1229 alpha
==============
It's not just "uname -a" - any multi-word command gives the problem.
I've tested this on Linux and on Digital Unix.
I imagine it's something to do with the quotes, but I can't figure it
out!
TIA
Mark Bergman
Manchester UK
mark . bergman @ thales - is . com