Skip to content

Instantly share code, notes, and snippets.

@derickr
Forked from chx/nato
Created Nov 26, 2013
Embed
What would you like to do?
#!/bin/bash
declare -A nato
nato[A]=Alpha
nato[B]=Bravo
nato[C]=Charlie
nato[D]=Delta
nato[E]=Echo
nato[F]=Foxtrot
nato[G]=Golf
nato[H]=Hotel
nato[I]=India
nato[J]=Juliet
nato[K]=Kilo
nato[L]=Lima
nato[M]=Mike
nato[N]=November
nato[O]=Oscar
nato[P]=Papa
nato[Q]=Quebec
nato[R]=Romeo
nato[S]=Sierra
nato[T]=Tango
nato[U]=Uniform
nato[V]=Victor
nato[W]=Whiskey
nato[X]=X-ray
nato[Y]=Yankee
nato[Z]=Zulu
nato[1]=One
nato[2]=Two
nato[3]=Three
nato[4]=Four
nato[5]=Five
nato[6]=Six
nato[7]=Seven
nato[8]=Eight
nato[9]=Nine
nato[0]=Zero
for x in "$@"
do
for (( i=0; i<${#x}; i++ ))
do
letter=${x:$i:1}
letter=${letter^^}
echo ${nato[$letter]}
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment