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
Thankyou for putting me out of my misery.
google thought i was trying to exclude something when i put "-" in
the search box and the word "minus" wasn't helping.
--- In email@example.com, "Brian Zhou" <b88zhou@...>
> Definitely not slug specific. But it is actually quite easy, try:
> grep [-][-] file
> -Brian Zhou
> --- In firstname.lastname@example.org, "bullfrog528" <yahoo@> wrote:
> > Hi
> > Yes not really a slug specific problem, or perhaps it is.
> > 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.
> > I've also tried
> > cat file|grep "--"
> > and
> > cat file|grep -i "--"
> > Just to see if specifying an option would have any effect.
> > Googling shows plenty of examples of escaped characters (for
> > non minus sign characters) and using the minus sign to match wild
> > cards but I can find nothing to help me here.
> > If anyone can give me a pointer please do.
> > Thanks
> > Jeremy