Skip to content

Instantly share code, notes, and snippets.

@geta6
Created April 28, 2012 15:06
Show Gist options
  • Save geta6/2519710 to your computer and use it in GitHub Desktop.
Save geta6/2519710 to your computer and use it in GitHub Desktop.
count 'a' in $s
s="abracadabra" ; s=(${(s:a:)s}) ; echo $(($#s[*]+1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment