[X-Unix] Argument variables in tcsh aliases

Jeff Porten civitan at jeffporten.com
Wed Aug 17 11:31:43 PDT 2005


Stumped by why I can't get my argument variable to work in an alias.   
Tcsh under Tiger (yes, I know; deliberately changed it until I have  
time to learn bash).

The command in question is:

alias ipcount "sort $1 | cut -f 1 -d ' ' | uniq -c | sort -nr | more"

Which works fine at the command line, but invoked from an alias will  
more the target file for one screen.  Control-C out of that puts it  
into some other process with no output; repeated breaks are needed to  
get back to a prompt.

(Incidentally, this will take a common.log file as argument and spit  
it back with a hit count, sorted by the most frequent users.  I've  
been using it to block aggressive spiders.)

Best,
Jeff


More information about the X-Unix mailing list