Skip to content

Instantly share code, notes, and snippets.

@isaquealves
Created July 14, 2017 14:22
Show Gist options
  • Save isaquealves/2c4f8563a0c8f0116db29eaa647eb6e1 to your computer and use it in GitHub Desktop.
Save isaquealves/2c4f8563a0c8f0116db29eaa647eb6e1 to your computer and use it in GitHub Desktop.
#!/bin/sh
# this works for Bash and Zsh shell
a=("it is true for all that that that that that that that refers to is not the same that that that that refers to")
# Use this with Fish shell
# set a "it is true for all that that that that that that that refers to is not the same that that that that refers to"
# or if you need to count words in a sample file,
# cat <file> | tr " " "\n" | sort -n | uniq -c
echo "$a" | tr " " "\n" | sort -n | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment