#!/bin/csh -f # addr # ----------------------------------------------------------------------------- # Shell script to look up an e-mail address. # ----------------------------------------------------------------------------- # Usage: See Usage section below or run with no arguments to see usage. # Assumptions: # Effects: # - Reports to stdout the e-mail address of a person # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv == 0) then echo "Usage: $0:t partial or full name or address" exit 1 endif # Strip off "BCC: " prefixes, find matching line and highlight the string sed -e "s/^BCC: //g" ~/fred/Mozilla/TBird/Lists/address.lis \ | grep -i --color $1:q set rc = $status # Show primary if more than one match. @ linecount = `grep -i $1:q ~/fred/Mozilla/TBird/Lists/address.lis | wc -l` if ($linecount > 1) then echo "" echo "Primary: " sed -e "s/^BCC: //g" ~/fred/Mozilla/TBird/Lists/address.lis \ | grep -i $1:q \ | grep -v " -- " \ | grep -i --color $1:q endif exit $rc