Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: csh (or tcsh) help needed
kre>
kre> which when written as the alias command
kre>
kre> alias Q4 "sed -e 's/"'\$'"//g'"
kre>
kre> where the \$ always appears inside single quotes so you don't need to
kre> deal with csh's weird "" rules ($ inside "" is always a variable reference,
kre> that can't be prevented by a \, so a literal $ needs to be unquoted \$ or
kre> single quoted).
True. Csh's insistance on ALWAYS tackling $s within "..." can be
counter-acted by using a nifty aux definion:
set dollar=$
The entire thing then becomes, without flipping between quoting styles:
alias Q4 "sed -e 's/\$dollar//g'"
I'd consider this "pretty agreeable". The entire(?) aux list
set dollar=$ sq=\' dq=\" bs=\\
can drag you through a other problematic contexts. Because,
csh won't let you put a ' within '...' or a " within "...",
either :-(
Note that any $ followed by white space or nothing at all is not
subject to variable expansion. IMHO, the easiest solution for
the task is
alias Q5 tr -d $
Look Ma, neither freaking quotes nor backslashes at all!
Martin
Home |
Main Index |
Thread Index |
Old Index