Substring replacement

Basic types / Strings

startString="3, 2, 1, go!"

#${var//from/to} replaces every occurrence, ${var/from/to} - the first one
startString=${startString//1/one}
startString=${startString//2/two}
startString=${startString//3/three}
#startString is "three, two, one, go!"

#for a whole file or a stream the same job is done by sed
fromSed=$(echo "3, 2, 1, go!" | sed 's/1/one/g; s/2/two/g; s/3/three/g')
#fromSed is "three, two, one, go!"

echo "startString is $startString"
echo "fromSed is $fromSed"