in reply to Re^2: grep command
in thread grep command
However, the last line in which "hello" is found is printed twice.
CLI: perl -n -e "print, $count++ while /\bhello\b/g; END { print $count }" hello.outfile hello.txt:
hello. hellow, world. bye
world says hello.
bye
hello, hellow, hello
not now.
done.
output
hello. hellow, world. bye
world says hello.
hello, hellow, hello
hello, hellow, hello
4
|
|---|