parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

csh help: how to quote * and ?


From: Ole Tange
Subject: csh help: how to quote * and ?
Date: Wed, 3 Oct 2012 15:28:00 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]