I wanted to center some text in my commandline application, so I came up with this function. centerText(){ textsize=${#1} spacecount=$(tput cols) spacecount=$((($spacecount-$textsize)/2)) while [ $spacecount -gt 0 ] do printf " " spacecount=$((spacecount-1)) done printf "$1" echo...