Re: strict grep when patterns are presented on standard input

From: Ariel Burbaickij (ariel.burbaickij_at_gmail.com)
Date: 07/28/04


Date: 28 Jul 2004 13:50:19 -0700

ariel.burbaickij@gmail.com (Ariel Burbaickij) wrote in message news:<3058f9b4.0407280407.74335d3d@posting.google.com>...
> Hello dear newsgroup participants,
>
> I have following problem:
> I would like to greo for some let us say IP addresses
> in /etc/hosts file. Grep is used in the pipe of commands
> and it is not known ahead of time what IP addresses will
> be presented to grep, so grep is used with -f - option.
> In the file entries of both 192.168.111.11 and 192.168.111.112
> are presented,only 192.168.111.11 is presented to the grep on
> standard input but both are presented on the standard output
> because they both contain the same string. Now my question:
> Can strict option/quotes etc. be applied to the grep when it becomes
> its arguments from standard input in the pipe (i.e. as standard output from
> other command)? Clear, I can add just another sed command to the pipe
> that will prepend and append quote sign but I so far it would be interesting
> to understand whether it goes directly with grep or not
>
>
> With Best Regards
> Ariel Burbaickij

Dum question, now I know it. -w option of grep will do it.



Relevant Pages

  • Re: strict grep when patterns are presented on standard input
    ... >> standard input but both are presented on the standard output ... I can add just another sed command to the pipe ... > Dum question, now I know it. ... -w option of grep will do it. ...
    (comp.unix.shell)
  • strict grep when patterns are presented on standard input
    ... Grep is used in the pipe of commands ... be presented to grep, so grep is used with -f - option. ... its arguments from standard input in the pipe (i.e. as standard output from ... I can add just another sed command to the pipe ...
    (comp.unix.shell)
  • Re: Unable to exit VI!!!
    ... Isn't the pipe actually feeding into xargs? ... xargs gets its standard input redirected from /dev/null. ... vi's file descriptor zero. ...
    (comp.unix.shell)
  • Re: piping multiple selections to mv or cp and exclusion
    ... tony wrote: ... but how do I pipe the stdout to mv or cp? ... remember grep takes regular expressions. ... Unfortunately we use windows at work so I'm using ports of unix tools: ...
    (comp.unix.shell)
  • Re: [opensuse] search for word in huge txt file
    ... On Monday 24 December 2007 15:11, Carlos E. R. wrote: ... The pipe helps if the problem is grep trying and failing to allocate ... operating on input supplied via a pipe does not in any way ...
    (SuSE)