also sprach Johannes Graumann <graumann@its.caltech.edu> [2002.07.29.0214 +0200]: > I followed this up and behold: if I say on host01 'ssh -2 -c 3des -l root > host02 echo $PATH', I get the PATH of host01 - really weired. Well, > following some intuition I tryed 'ssh -2 -c3des -l root host02 > /sbin/reboot' and that works! > > I'm puzzeled - can somebody please explain to me why this happens? $PATH gets evaluated in the local shell, so you are asking to remote system to echo that. Escape the $ and it'll work: ssh -2 -c 3des -l root host02 echo \$PATH Now you are telling the local shell to treat $ as $ and not as a variable indicator. The remote system, however, will see $ as the start of a variable and expand it accordingly. -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck "vulgarity is simply the conduct of other people." -- oscar wilde
Attachment:
pgpUm5oEHoPPC.pgp
Description: PGP signature