Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Anyone help with this?

Trying to use perl -e in a csh alias, but can't find the right combination of "/'/and backslashes to make this work... The command strips out any lines containing '$mail_cmd'...

alias rfw "cat \!^ | sybperl -e 'while (<>) { print if !/$mail_cmd/; } +' | sybperl"
This is a simple example which can be achieved using grep or sed, but does anyone know how to solve the general problem & define this alias?

No wonder the perl gurus created q() & qq() - very smart :)

Thanks

Replies are listed 'Best First'.
Re: csh, alias, perl & quotes
by sh1tn (Priest) on Jun 17, 2005 at 10:19 UTC
    cat filename | perl -ne '/\$mail_cmd/||print' # or perl -ne '/\$mail_cmd/||print' filename


      A reply falls below the community's threshold of quality. You may see it by logging in.
      The problem is getting the perl -e code inside a csh alias when the perl code includes $ and !'s...
        Smylers - many thanks for taking the time to explain this :)