Problem scenario
You want to count the number of "(" (open parens) in a string. How do you parse a string in Bash?
Solution
Remember to use awk. The -F flag can allow you to designate a character to count and the NF flag can count the occurrences.
echo "continualintegration" | awk -F "o" '{print NF-1}'
echo "c(ntinua((lintegrati(n" | awk -F "(" '{print NF-1}'
You may also want to see this posting parse an array.