Search
 
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
Name
1+1 =