Re: [nslu2-general] grep problem
- On 10/6/06, bullfrog528 <yahoo@...> wrote:
> I'm trying to search a file with lines containing 2 dashes.The problem has to do with how shell and grep interact in parsing
> 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.
their arguments. You need to somehow indicate that the command line
flags are finished and to stop parsing for those. The following works
$ 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.
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