shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Re: SED - Como parar a consulta na N ocorrência


From: Tiago Peczenyj
Subject: Re: [shell-script] Re: SED - Como parar a consulta na N ocorrência
Date: Tue, 22 Aug 2017 15:34:30 +0200

wow

em tantos anos eu nunca usei esta opção

       -m NUM, --max-count=NUM
              Stop reading a file after NUM matching lines.  If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned
              to just after the last matching line before exiting, regardless of the presence of trailing context lines.  This enables a calling process to resume a search.  When  grep  stops  after
              NUM  matching  lines,  it outputs any trailing context lines.  When the -c or --count option is also used, grep does not output a count greater than NUM.  When the -v or --invert-match
              option is also used, grep stops after outputting NUM non-matching lines.


2017-08-22 15:29 GMT+02:00 address@hidden [shell-script] <address@hidden>:
 

Caro André

Nesse caso acho melhor usar o grep:

 grep -m 2 '\b192.168.1.4\b' ips.txt


[]'s
Itamar





--
Tiago B. Peczenyj

http://about.me/peczenyj

reply via email to

[Prev in Thread] Current Thread [Next in Thread]