#!/bin/csh -f # opinions # ----------------------------------------------------------------------------- # Shell script to check my notes about a person's opinion. # ----------------------------------------------------------------------------- # Usage: See Usage section below or run with no arguments to see usage. # Assumptions: # Effects: # - Writes to sdtout and loads editor on notes files # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv == 0) then echo "Usage: $0:t word to search for" exit 1 endif # Search TBird address book for blocks of lines containing person, piping # the output to less and having it scroll to and highlight the word # "description", which is where my comments are stored, and wrap long lines # to avoid having to scroll sideways to read them #search -i $1:q ~/fred/Mozilla/TBird/Profile/abook.ldif | less -I -+S -+F +/description # Search TBird address book for blocks of lines containing the person. # Pipe to grep to show only lines containing the word "description". # Pipe to sed to strip out "description: " at start of line. # Pipe to sed to change " ... " to a blank line. # This is because " ... " is the delimiter I've always used in TBird # notes where newline or any other special chars, including non-ASCII # Unicode chars, cause the text of the note to be base64 encoded in the # LDIF file, not shown as plain ASCII. search -i $1:q ~/fred/Mozilla/TBird/Profile/abook.ldif | grep -i description | sed -e "s/^description: //g" | sed -e "s/ \.\.\. /\n\n/g"