quoting $ in the Csh

Doug Schmidt schmidt at siam.ics.uci.edu
Sun Dec 11 15:47:17 AEST 1988


Hi,

   I'm attempting to create an csh alias that will filter out all
blank lines from a given file ( i.e., replace a sequence of blank
lines with *no* blank lines ).  The following grep argument does the
trick:

grep -v '^[ ^I]*$'  # the ^I stands for tab

However, when I attempt to make this a csh alias, e.g.:

alias sqz "grep -v '^[ ^I]*$'"

The cshell complains about ``variable syntax,'' since it appears to be
attempting to expand $'.  I've tried escaping the $, and that doesn't
help.  I've tried putting an extra space between the $ and ', but that
screws up the regular expression.  

Does anyone know of a good method for getting this to work?!

thanks,

Doug Schmidt
--
schmidt at ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
                           |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.



More information about the Comp.unix.questions mailing list