Program to print string in reverse order

Q.एक ऐसा शैल program लिखिए जो कि एक string को reverse order मे print करे।Ans.read -p “Enter string:” string
len=${#string}
for (( i=$len-1; i>=0; i– ))
do
# “${string:$i:1}”extract single single character from string.
reverse=”$reverse${string:$i:1}”
done
echo “$reverse”