gabriel rosenkoetter on Tue, 3 Sep 2002 14:50:07 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Silly rsh question...


On Tue, Sep 03, 2002 at 08:12:10AM -0400, Guillermo Moyna wrote:
> echo '$var'
> 
> Which prints '$var' on the screen. Now, if I do the same through rsh, I 
> get nothing:
> 
> rsh somemachine echo '$var'

That's because rsh is stripping the quotes when it passes them
across (arguably a bug, since it does pass multiple variables
correctly, but whatever).

> And I get null. Any clues as to how to pass something with a $ in it 
> protected from the shell through rsh to another machine?

Try rsh host echo \'$var\'

For added fun with characters-shells-will-strip, try:

  tar cf - | rsh host \( cd todir \&\& tar xpf - \)

(Throw a v on one of those tar's if you don't have balls of steel.
;^>)

Note, btw, that in my example, *some* shells would let you do rsh
host '( cd todir && tar xpf - )', but I don't trust it (and you
really don't want the shell grabbing the &&, and then the tar x
happening locally by accident if you're moving, say, /home because
the disk is full...), which *maybe* justifies the ' weirdity. Maybe.

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpsXQseuEWkR.pgp
Description: PGP signature