Guillermo Moyna on Tue, 3 Sep 2002 16:10:08 +0200


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

Re: [PLUG] Silly rsh question...


| > 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,

the quotes are stripped by your local shell, not rsh.
no bug.

| Try rsh host echo \'$var\'

no. you are then escaping the single quotes, and the local
shell[1] will try interpolating $var. you need to protect
against both the local and remote shell, something like:

    rsh host echo \'\$foo\'
    rsh host echo \\\$foo
    rsh host echo \''$foo'\'
    ...

[1] I'm using csh, other shells may have slightly different quoting rules.


Actually, this:

rsh host echo \'$var'

works fine. I now how to figure out how to make this string in a perl script so that it can pass it to a system call. Thanks!

Guillermo

+==================-------------- --- -- -  -    -     -
Guillermo Moyna, PhD
Assistant Professor of Chemistry
Department of Chemistry & Biochemistry
University of the Sciences in Philadelphia
600 South 43rd Street
Philadelphia, PA 19104-4495

 "The only existing things are atoms and empty space.
  All else is mere opinion" - Democritus, 370 B.C.

Office: Griffith Hall 360
Phone:  (215) 596-8526
Fax:    (215) 596-8543
e-mail: g.moyna@usip.edu
WWW:    http://tonga.usip.edu/gmoyna/index.html
        http://www.usip.edu/chemistry/faculty/moyna.asp
     -     -   -  - -- --- -----------=================+

_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug