Skip to content

Instantly share code, notes, and snippets.

@Frodox
Last active January 4, 2016 19:09
Show Gist options
  • Save Frodox/8665478 to your computer and use it in GitHub Desktop.
Save Frodox/8665478 to your computer and use it in GitHub Desktop.
Count char accourence
#!/bin/bash
$ echo "qwertyuuiop cxcx xcxc x x xc x" | tr -cd ' '|wc -c
# work with unicode
$ echo "qwertyuuiop cxcx xcxc x x xc x" | grep -o 'x'|wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment