Skip to content

Instantly share code, notes, and snippets.

@mtrovilho
Created September 1, 2013 15:58
Show Gist options
  • Save mtrovilho/6405357 to your computer and use it in GitHub Desktop.
Save mtrovilho/6405357 to your computer and use it in GitHub Desktop.
simple script to convert letters into numbers from telephone pad
#!/bin/sh
INPUT="${1}"
echo $INPUT |\
tr -cd '[:alnum:]' |\
tr 'aAbBcC' '2' |\
tr 'dDeEfF' '3' |\
tr 'gGhHiI' '4' |\
tr 'jJkKlL' '5' |\
tr 'mMnNoO' '6' |\
tr 'pPqQrRsS' '7' |\
tr 'tTuUvV' '8' |\
tr 'wWxXyYzZ' '9'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment