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 05:07:51 -0700

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



Relevant Pages

  • Re: Some bash questions :-)
    ... The bash command below is meant to firstly list all files with the ... Try `grep --help' for more information. ... You probably don't want to "pipe" it per se. ... of the readlink command as an argument to cd, ...
    (comp.os.linux.misc)
  • Re: MacTeX 2007 and documentation
    ... may be the most useful command available when doing searches at the ... will find every file on your system that has the text "memoir" on it, ... If locate generates 30 lines of text, where each line is a file, grep ... I need a Unix guru to chat to for half an hour or so to put me straight. ...
    (comp.text.tex)
  • Re: piping multiple selections to mv or cp and exclusion
    ... pipe to shell to execute each command statement ... Unix is indeed lifelong learning :-) ... and the regexp. ... back into the grep statement. ...
    (comp.unix.shell)
  • Re: MacTeX 2007 and documentation
    ... means you need expertise in your host operating system as well. ... locate memoir | grep pdf ... I'm not someone who lives at the command line, ...
    (comp.text.tex)
  • Re: strict grep when patterns are presented on standard input
    ... > 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 ... I can add just another sed command to the pipe ...
    (comp.unix.shell)

Loading