Magari c'è un programmino apposito, come ci sono cat e tac; però non lo trovo...
Cmq non è difficile: potresti fare così:
Codice:
#!/bin/bash
[ $# = 0 ] && exit 1
# prende tutti gli argomenti come una stringa unica
stringa="$@"
stringaR=""
lung=$(expr length "$stringa")
for((i=1; i<=$lung; i++)); do
pos=$(($lung-$i+1))
stringaR=$stringaR$(expr substr "$stringa" $pos 1)
done
echo $stringaR
adattandolo per il tuo script, dove serve.