seraching for string containing $ in grep

From: John Dunn (jdunn_at_sefas.com)
Date: 05/04/05

  • Next message: Green, Simon: "Re: what is your way in the future when PSSP runs out of support?"
    Date:         Wed, 4 May 2005 10:40:19 +0100
    To: aix-l@Princeton.EDU
    
    

    I have a script containing the following grep command(which searches a file
    for the $SEARCH value, ignoring the first 8 characters in each line).

    However I am having problems in that sometimes the string to search for can
    begin with a $ sign, e.g. $SEARCH can contain $JOHN

    I cannot get the script to work in this case. Any ideas?

    SEARCH=$1
    DIR=$2
    FILE=$3

    grep -E "^.{8,8}.*$SEARCH" $DIR/$FILE


  • Next message: Green, Simon: "Re: what is your way in the future when PSSP runs out of support?"