I have printed a character on the screen using a shell script. I want to move that character one space to the left. I have tried moving the cursor to the top left corner of the screen and printing a backspace, like this:
tput cup 1 1;
printf "\b";
The backspace supposedly deletes the character under the cursor. But it won't do anything for me.
If you use same tput more than once with some constant argument(s) then do tput once and save output.
After that use variable.
lear
cat <<EOF
=========================================================
Screen test
EOF
loc0_0=$(tput cup 0 0)
bold=$(tput smso)
boldoff=$(tput rmso)
save_loc=$(tput sc)
ret_loc=$(tput rc)
# after this init, use variable
echo "${bold}BoldText${boldoff} and not so bold"
echo -e "(Look line 1) Ask here:${save_loc}${loc0_0}LOCATION 0,0 IS HERE ***************${ret_loc}\c"
read answer
echo "${save_loc}${loc0_0}Your answer:$answer ${ret_loc}"
echo