in reply to Conditional question

This is how I would expect it to work but it obviously doesn't:

It obviously doesn't because of a glaring typo. (HINT: It has nothing to do with STDIN.)

Have you tried using the debugger, or judious print statements? Another HINT: After testing, what command wasn't understood?