Re: grep matched pattern??



Thanks a lot.well done!

Bill Marcum wrote:
On 29 Aug 2006 00:26:45 -0700, zdk
<nx2zdk@xxxxxxxxx> wrote:
How to grep with specific pattern and just its first matched?

example:

grep something *

it will return

blah blah .... something
blah blah .... something
blah blah .... something

(this difference on its timestamp)

but I need just one line....

how to program a shell script ?

any help or suggest would be greatly appreciated much.thanks a lot.

Warachet S.

grep something * | head -n 1


--
Stay the curse.

.



Relevant Pages

  • Re: bash null conditional
    ... A125 definitely is null when I just run the grep command in the quotes ... you are asking if the literal string "grep A121 myfile.csv" ... Is the string "grep blah blah blah" non-zero? ...
    (Fedora)
  • Problem with grep
    ... I have the latest version of grep and it has a "feature" now that I may ... (then do blah blah blah...) ... and it gives me an "ILLEGAL OPTION" error. ...
    (Fedora)
  • Re: grep matched pattern??
    ... John W. Krahn wrote: ... grep -m 1 something * ...
    (comp.unix.shell)
  • grep matched pattern??
    ... How to grep with specific pattern and just its first matched? ... Warachet S. ...
    (comp.unix.shell)
  • Re: grep matched pattern??
    ... zdk wrote: ... (this difference on its timestamp) ... grep -m 1 something * ...
    (comp.unix.shell)