[nycbug-talk] Stupid mistake ... just checking :)

Matt Juszczak matt at atopia.net
Wed Jul 21 02:08:43 EDT 2010


Hi all,

Tonight, I was coding up a script, and made a stupid mistake (toooo 
tired).

Long story short, I ended up having something like this inside my shell 
script:

`ssh blah.hoarf.com`

(including the backticks)

I spent hours debugging it after I kept getting errors that "Last" was an 
invalid command.  Turns out that because I had the backticks, it was 
reading the "Last Login" output from the login, and trying to execute that 
locally (and failing).

To make matters worse, since the command was in backticks, nothing was 
being printed to the screen on STDOUT... but what I was typing was 
actually being sent to the remote server (I have ssh keys setup, so the 
connection was made with no Password: prompt).

I'm pretty sure I'm okay, and this was a trivial mistake.  After all, I 
was mostly typing things like 'wtf', etc. :)  No majorly bad commands. 
My main question is:

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 
(since there was nothing other than `ssh <server>` in the backtick call).

Just want to make sure :)

Thanks all,

Matt



More information about the talk mailing list