[nycbug-talk] Stupid mistake ... just checking :)
njt at ayvali.org
Wed Jul 21 10:52:19 EDT 2010
* Matt Juszczak <matt at atopia.net> [2010-07-21 02:08:43-0400]:
> `ssh blah.hoarf.com`
> I spent hours debugging it after I kept getting errors that "Last" was an
> invalid command.
Whenever you are debugging shell scripts, "set -e" and "set -x" are your
best friends. Dollars to donuts you have would have found that error in
60 seconds with both of those turned on. =-)
> The only possibility something would have been executed by "rogue output"
> would have been locally on my laptop right? The only way something would
> have been executed on the remote server is if I would have typed it in
Correct. Whatever the output of "ssh host" was would have been executed
on your laptop (I'm assuming it was mostly garbage that was not
meaningful to your shell script); but not on the server.
The only exception to this rule is if somehow "ssh host" produced
textual output (like from /etc/motd maybe) to the effect of "ssh host
<meaningful command>" but that is highly unlikely, and you can double
check this by running "ssh host" yourself and seeing if any such string
More information about the talk