Skip to content

Instantly share code, notes, and snippets.

@lukeorland
Forked from anonymous/bashabbrv.sh
Created October 25, 2012 06:48
Show Gist options
  • Save lukeorland/3950910 to your computer and use it in GitHub Desktop.
Save lukeorland/3950910 to your computer and use it in GitHub Desktop.
function split_novowel {
echo $1 | cut -d_ -f$2 | sed 's/[aeiou]//g'
}
function abbr {
echo $(split_novowel $1 1 | cut -c 1-3)$(split_novowel $1 2 | cut -c 1-1)
}
abbr Computer_Hardware
@lukeorland
Copy link
Author

The result of the last line will be CmpH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment