Find the answer to your Linux question:
Page 5 of 5 FirstFirst 1 2 3 4 5
Results 41 to 42 of 42
That's because there is a literal 'backslash' (which is probably being used as a line continuation character) in the text file - it needs to be "escaped" so that grep ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #41
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353

    That's because there is a literal 'backslash' (which is probably being used as a line continuation character) in the text file - it needs to be "escaped" so that grep can handle it.

    Change these lines:
    Code:
          if [ -f whitelist.txt ]; then
            cat whitelist.txt|grep -q "$phrase" && continue
          fi
    to this:
    Code:
          if [ -f whitelist.txt ]; then
            grepphrase=$(echo $phrase|sed -e 's|\\||g')
            cat whitelist.txt|grep -q "$grepphrase" && continue
          fi

  2. #42
    Just Joined!
    Join Date
    Jan 2011
    Posts
    87
    thanks for all of your help

Page 5 of 5 FirstFirst 1 2 3 4 5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •