DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR SHELL
bash count occurrences of string in array
let count=0 for x in ${my_array[*]}; do if [ $x == 'abc' ] then count=$((count+1)) fi done
PREVIOUS
NEXT
Tagged:
#bash
#count
#occurrences
#string
#array
ADD COMMENT
Topic
COMMENT
Name
7+8 =
Submit