In string \"12345\", out string \"54321\". Preferably without third party tools and regex.
This reverses the string "in place":
a=12345 len=${#a} for ((i=1;i
or the third line could be:
for ((i=0;i
or
for ((i=1;i