TPUT and TERMINFO
Using the command line as UI ? try to remember some of these useful commands !
Some more advanced stuff can be done :
# save cursor position tput sc # move cursor to 10th line and 20th column tput cup 10 20 # write some text from here in standout mode tput smso echo "j ecris a partir de la 10eme ligne et la 20eme colonne" # restore cursor position tput rc # exit from standout mode tput rmso
Some more advanced stuff can be done :
# save your prompt PS1_SAVE=$PS1 # set the prompt to blank PS1='' # save the number of colums of the terminal COLUMNS=$(tput cols) # save the number of lines of the terminal LINES=$(tput lines) # set the message you want to display (here it's "hello I am at the center of the term") message="coucou je suis au milieu du terminal" # get the horizontal position to center your text hpos=$(expr $LINES / 2) # get the vertical position to center your text vpos=$(expr \( $COLUMNS - $(echo "$message" | wc -c) \) / 2) # move the cursor to that position tput cup $hpos $vpos # enter in reverse video mode tput rev # display the message echo "$message" # wait for 3 second to see the message sleep 3 # recall your default prompt PS1=$PS1_SAVE # reset all terminal settings tput sgr0 # clear the screen tput clear