Skip to content

Instantly share code, notes, and snippets.

@nexus166
Last active July 28, 2020 17:57
Show Gist options
  • Select an option

  • Save nexus166/b335b79e24b0e9055efa63729b015628 to your computer and use it in GitHub Desktop.

Select an option

Save nexus166/b335b79e24b0e9055efa63729b015628 to your computer and use it in GitHub Desktop.

Revisions

  1. nexus166 revised this gist Jul 28, 2020. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions radiotelephony_spelling.sh
    Original file line number Diff line number Diff line change
    @@ -30,11 +30,10 @@ CHART+=(
    )

    INPUT="${*}"
    LENGTH=${#INPUT}
    for ((i = 0; i < LENGTH; i++)); do
    for ((i = 0; i < ${#INPUT}; i++)); do
    _c="${INPUT:i:1}"
    case "${_c}" in
    " ") printf '\t' ;;
    *) printf '[%s]%s ' "${_c}" "${CHART["${_c}"]}" ;;
    esac
    done
    done
  2. nexus166 created this gist Jul 28, 2020.
    40 changes: 40 additions & 0 deletions radiotelephony_spelling.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    #!/usr/bin/env bash

    declare -A CHART=(
    ["a"]="alpha" ["b"]="bravo" ["c"]="charlie"
    ["d"]="delta" ["e"]="echo" ["f"]="foxtrot"
    ["g"]="golf" ["h"]="hotel" ["i"]="india"
    ["j"]="juliet" ["k"]="kilo" ["l"]="lima"
    ["m"]="mike" ["n"]="november" ["o"]="oscar"
    ["p"]="papa" ["q"]="quebec" ["r"]="romeo"
    ["s"]="sierra" ["t"]="tango" ["u"]="uniform"
    ["v"]="victor" ["w"]="whiskey" ["x"]="x-ray"
    ["y"]="yankee" ["z"]="zulu"
    )
    for _c in "${!CHART[@]}"; do
    CHART["${_c^^}"]="${CHART[${_c}]^^}"
    done
    CHART+=(
    ["1"]="ONE" ["2"]="TWO" ["3"]="THREE"
    ["4"]="FOUR" ["5"]="FIVE" ["6"]="SIX"
    ["7"]="SEVEN" ["8"]="EIGHT" ["9"]="NINE"
    ["0"]="ZERO" ["!"]="exclamation" ["?"]="questionmark"
    ["#"]="hash" ["&"]="ampersand" ["+"]="plus"
    ["-"]="dash" ["|"]="pipe" ["$"]="dollar"
    ["%"]="percent" ["_"]="underscore" ["/"]="slash"
    ['\']="backslash" ["*"]="asterisk" ["@"]="at"
    ["="]="equals" ["("]="left parenthesis" [")"]="right parenthesis"
    ["["]="square bracket open" ["]"]="square bracket closed" ["{"]="brace open"
    ["}"]="brace closed" ["."]="dot" [","]="comma"
    [";"]="semicolon" [":"]="colon"
    )

    INPUT="${*}"
    LENGTH=${#INPUT}
    for ((i = 0; i < LENGTH; i++)); do
    _c="${INPUT:i:1}"
    case "${_c}" in
    " ") printf '\t' ;;
    *) printf '[%s]%s ' "${_c}" "${CHART["${_c}"]}" ;;
    esac
    done