Find the answer to your Linux question:
Results 1 to 3 of 3
Hello all, I have a question regarding grep an meta-characters.How can I search for a string with grep without interpreting meta-characters.The idea is that I don't want to interpret their ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    4

    Question grep escape methacharacters

    Hello all,

    I have a question regarding grep an meta-characters.How can I search for a string with grep without interpreting meta-characters.The idea is that I don't want to interpret their special meaning I ant grep to interpret the string as it it.

    I know that I can escape them but for me this is not an answer because the string that I'll search for is given by a script so I don't know how it looks like.

    I looking for something (a flag or another unix utility) that doesn't interpret regexp characters.

    Thanks!

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    2
    use fgrep or grep -F if the -F switch is supported by your grep

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    4
    Thanks a lot!

    Quote Originally Posted by mrtiller View Post
    use fgrep or grep -F if the -F switch is supported by your grep

Posting Permissions

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