samedi 30 août 2014

SED: Number of returned lines


Vote count:

0




To a file jungle.txt with following text ...



A lion sleeps in the jungle
A lion sleeps tonight
A tiger awakens in the swamp
The parrot observes
Wimoweh, wimoweh, wimoweh, wimoweh


... one could perform GREP search ...



$ grep lion jungle.txt


... or SED search ...



$ sed "/lion/p" jungle.txt


... to find occurences of a pattern ("lion" in this case).


Is there some easy way to get a number of returned lines? Or at least to know that there were more than 1 found? As always, I've googled a lot first, but surprisingly found no answer.


Thanks!



asked 26 secs ago







SED: Number of returned lines

Aucun commentaire:

Enregistrer un commentaire