Tente isso com script.sh "HELP ME"
:
#!/bin/bash
input=$1;
declare -A code
code=( [H]="h" [E]="e" [L]="l" [P]="p" [M]="m" [E]="e" )
for ((i=0; i<${#input}; i++))
do
if [[ "${input:$i:1}" = " " ]]; then # whitespace?
echo -n " "
else
echo -n "${code[${input:$i:1}]}"
fi
done
Saída:
help me