As mentioned, this is a potentially huge topic. So, I'm just going to give you a trivial example, and say "Go read the man-page on tput". Well, okay, actually, you have to read the "tput" manpage, AND either the "terminfo" or "termcap" manpage to figure out what magical 3-5 letter name to use. For example, it should tell you that "cup" is short for the "cursor_address" command. But you must use "cup", NOT "cursor_address", with tput.
tput init tput clear tput cup 3 2 print -n "Here is a clean screen, with these words near the top" endline=`tput cols` tput cup $(($endline - 2)) print "and now, back to you" sleep 2
No comments:
Post a Comment