10.8 Fix Quoting in csh Aliases with makealias and quoteGetting quoting right in aliases can be a real problem. Dan Bernstein wrote two aliases called makealias and quote that take care of this for you. For example, here I use makealias
to avoid having to quote % I typed the The properly quoted alias definition is sent to the standard output. That line is what you would use to define the alias. [2]
And here are the quote and makealias aliases themselves: alias quote "/bin/sed -e 's/\!/\\\!/g' \ -e 's/'\\''/'\\'\\\\'\\''/g' \ -e 's/^/'\''/' -e 's/"\$"/'\''/'" alias makealias "quote | /bin/sed 's/^/alias \!:1 /' \!:2*" Pretty gross, but they do the job. - in comp.unix.questions on Usenet, 17 February 1991 |
|