My shell-fu is weak, and these SGI (IRIX 6.5) boxes aren't helping. It works as I would expect on Linux.
The ultimate goal is to run one or more shell scripts on a remote system. There is one shell script in an appropriate location, so this should be simple:
$ ssh remote.host '/bin/sh -c "for s in *.sh; do echo \$s; done"'
s - Undefined variable
...huh, ok. Out of random curiosity, just changing the variable name:
$ ssh remote.host '/bin/sh -c "for i in *.sh; do echo \$i; done"'
12
It's similarly fail-inducing with this:
$ ssh remote.host '/bin/sh/ -c "for s in `ls *.sh`; do echo \$s; done"'\
s - Undefined variable
Can someone teach me the magic spell for IRIX?