Skip to content

Instantly share code, notes, and snippets.

@david-pm
Created June 18, 2016 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-pm/47f4f93a5b29ac00b2f6466eedc05d5e to your computer and use it in GitHub Desktop.
Save david-pm/47f4f93a5b29ac00b2f6466eedc05d5e to your computer and use it in GitHub Desktop.
character count in each file in directory with and without special chars
#!/bin/bash
for i in $(ls)
do
without=$(cat $i | wc -c)
with=$(cat -vet $i | wc -c)
echo -n "chars including special chars in: $i "
echo "$with - $without"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment