I am trying to develop '--env VAR' so $VAR will be copied through ssh to the remote shell.
I have a working version for bash/sh. It also works for csh/tcsh UNLESS $VAR contains * or ?. If you are a (t)csh user, please help out with this. The generated shell code looks like this if $FOO='*'. It works fine if FOO=bar. ssh server eval\ \`echo\ \$SHELL\ \|\ grep\ -E\ \"/\(t\)\?csh\"\ \>\ /dev/null\ \&\&\ echo\ setenv\ FOO\ \\\\\\\\\\\*\\\;\ \|\|\ echo\ export\ FOO=\\\\\\\\\\\*\\\;\`\;echo\ \"\$FOO\"\ a; The generated shell code should work on sh/bash/tcsh/csh which is the reason for the weird 'eval', that will use 'setenv' if the $SHELL is (t)csh and 'export' otherwise. I have explained a little more about the problem on http://superuser.com/questions/482481/transferring-environment-variable-through-ssh-quoting-in-bash-sh-csh-tcsh/482487 /Ole
