Loading ...
Sorry, an error occurred while loading the content.
 

Re: [nslu2-general] grep problem

Expand Messages
  • Thaths
    ... The problem has to do with how shell and grep interact in parsing their arguments. You need to somehow indicate that the command line flags are finished
    Message 1 of 4 , Oct 6, 2006
      On 10/6/06, bullfrog528 <yahoo@...> wrote:
      > I'm trying to search a file with lines containing 2 dashes.
      > cat file|grep --
      > complains because it thinks I'm trying to use an option of dash.

      > If anyone can give me a pointer please do.

      The problem has to do with how shell and grep interact in parsing
      their arguments. You need to somehow indicate that the command line
      flags are finished and to stop parsing for those. The following works
      for me:

      $ cat file | grep -- --

      The first '--' tells the shell/grep to stop parsing for command line
      flags. The second '--' is the string to grep to search for.

      Thaths
      --
      Homer: He has all the money in the world, but there's one thing he can't buy.
      Marge: What's that?
      Homer: (pause) A dinosaur.
      -- Homer J. Simpson
      Sudhakar Chandra Slacker Without Borders
    Your message has been successfully submitted and would be delivered to recipients shortly.