multi-word remote shell parameters from a variable

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
 
R

Richard Bos

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!

And what, pray, doth make this a question about the language yclept C?

Richard
 
J

Joona I Palaste

And what, pray, doth make this a question about the language yclept C?

But Richard, don't you know that Unix was written in C? The Apache WWW
server was also written in C, so therefore questions about the correct
MIME types for different plugin formats are of course on-topic for
newsgroups about the C language. =)
 
E

Ed Morton

Mark said:
We have inherited a script which runs rsh (remote shell)

Sorry, you're OT for comp.lang.c. Post to comp.lang.shell or
comp.unix.questions and you'll get an answer.

Ed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,137
Messages
2,570,797
Members
47,342
Latest member
eixataze

Latest Threads

Top