I came across with code like this:
function cursorBack() {
echo -en "\033[$1D"
}
...
tput civis
...
cursorBack 1
What does the number do?
I came across with code like this:
function cursorBack() {
echo -en "\033[$1D"
}
...
tput civis
...
cursorBack 1
What does the number do?
It's an argument to the function: note the $1 part in the echo string: that is the first argument being used by the bash function. Try running the function with varying arguments, e.g. cursorBack 5, or even cursorBack foo, to see what happens.
Note that the first part of the echo command is an ANSI escape, followed by the function argument (a number), followed by the letter D. That letter means back (think delete, without removing the character), so it moves it n positions back (1 position in your example).
Logically, using foo as an argument will thus not do what it's supposed to do: the arguments in this specific case should only be (integer) numbers.