[CentOS] question on grep
James Olin Oden
james.oden at gmail.comWed Oct 10 20:15:53 UTC 2007
- Previous message: [CentOS] question on grep
- Next message: [CentOS] question on grep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/10/07, Ross S. W. Walker <rwalker at medallion.com> wrote: > mups.cp wrote: > > > > A simple one > > # echo "jerry jerry" | tr " " "\n" | grep -c jerry > > 2 > > > > The perl seems more general. > > > To add yet another variation: > > echo "jerry jerry" | awk 'BEGIN {RS=FS} {/jerry/ jerry++} END {print jerry}' > Did you mean: echo "jerry jerry" | awk 'BEGIN {RS=FS} /jerry/ {jerry++} END {print jerry}' The one you gave does not handle "jerry blue jerry" for instance? Cheers...james
- Previous message: [CentOS] question on grep
- Next message: [CentOS] question on grep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list