> any csh experts handy?  I'm trying to define an alias in my .cshrc to
> remove dollar-signs, but I can't seemm to get the quoting right:
>
>       alias Q4 'sed -e "s/\$//g"'
>
> TIA

   Something like this?

% echo $?backslash_quote
0
% alias Q4 'sed -e '"'"'s/\$//g'"'"
% echo 'a$b$c' | Q4
abc
% which Q4
Q4:      aliased to sed -e 's/\$//g'

   I find it more reliable to switch between single and double quotes than
to rely on backslashing quotes inside quotes.

   Note that things are different with backslash_quote set.

% set backslash_quote
% alias Q4 'sed -e '"'"'s/\$//g'"'"
% echo 'a$b$c' | Q4
a$b$c
% which Q4
Q4:      aliased to sed -e 's/$//g'

   There may be a way to do it properly with backslash_quote set, but I
got annoyed and gave up before I found it. You should also verify that
it works the same in scripts as from the command line. It may just be
the environment at $WORK, but I've noticed things working differently
in the different environments.

   Good luck...

                         Gary Duzan


Reply via email to