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
In reply to Re^3: grep command
by ww
in thread grep command
by sanku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |