DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR SHELL
program to count the number of occurrences of a word in a string in UNIX
$ grep -o "pattern" file_name | wc -l
PREVIOUS
NEXT
Tagged:
#program
#count
#number
#occurrences
#word
#string
#UNIX
ADD COMMENT
Topic
COMMENT
Name
8+7 =
Submit