For example, I want to create an alias to remove duplicate lines:
alias rm.dup 'perl -ne 'print unless $dup{$_}++;''
When source .cshrc, it reports: "dup: Undefined variable."
If change it to
alias rm.dup 'perl -ne 'print unless \$dup{$_}++;' \!* &'
It reports: "!* &: Command not found."
And also tried
alias rm.dup 'perl -ne 'print unless \$dup{$_}++;''
Reports: ": Command not found."
What's the general rule of using variable with alias?