dotfiles/scripts/nato
rpriven 5b6af65def
Organize scripts and clean up dotfiles
Changes:
- Added 80+ scripts with organized structure
  - payloads/ for third-party pentesting tools
  - pentesting/ for custom security scripts
  - Daily drivers remain flat for fast access
- Converted wes() function to proper script
- Removed .sh extensions from pentesting scripts
- Cleaned up aliases (removed 31 redundant lines)
- Added kanata/, build artifacts to gitignore
- Removed old fre.sh scripts and empty a.out
- Updated configs: helix, tmux, zsh, ulauncher, redshift

Security: All sensitive data excluded via gitignore
2025-11-07 14:48:21 -07:00

43 lines
1.3 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# Script Name: nato
# Description: Convert strings to NATO phonetic alphabet
# Source: Inspired by https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/
# Usage: nato bar # Output: Bravo Alfa Romeo
# nato "hello 123"
if [[ $# -eq 0 ]]; then
echo "Usage: nato <string>" >&2
exit 1
fi
# NATO phonetic alphabet mapping
declare -A nato_map=(
[a]="Alfa" [b]="Bravo" [c]="Charlie" [d]="Delta" [e]="Echo"
[f]="Foxtrot" [g]="Golf" [h]="Hotel" [i]="India" [j]="Juliett"
[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]="Xray" [y]="Yankee"
[z]="Zulu"
[0]="Zero" [1]="One" [2]="Two" [3]="Three" [4]="Four"
[5]="Five" [6]="Six" [7]="Seven" [8]="Eight" [9]="Niner"
)
# Convert all arguments to lowercase and process each character
input="$(echo "$*" | tr '[:upper:]' '[:lower:]')"
result=()
while IFS= read -r -n1 char; do
# Skip empty characters
[[ -z "$char" ]] && continue
if [[ -n "${nato_map[$char]:-}" ]]; then
result+=("${nato_map[$char]}")
elif [[ "$char" == " " ]]; then
result+=("/") # Use / as space separator
fi
done <<< "$input"
# Output with spaces between words
echo "${result[*]}"