Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash count occurrences of string in array

for word in ${myarr[*]}; do
  echo $word
done | grep -c "hello"
 
PREVIOUS NEXT
Tagged: #bash #count #occurrences #string #array
ADD COMMENT
Topic
Name
8+1 =