The stty Command The tset, tput, and stty Commands

echo This is an {HI}example{LO} of how to highlight a specified {HI}part of the text{LO} echo \n Upon execution, the script will display letters printed in bold are highlighted: tmpmso_example.ksh This line is highlighted This is an example of how to highlight a specified part of the text = The system prompt appears at the end of the scripts execution.

11.2.3 The stty Command

The stty command is used to specify generic terminal and terminal line characteristics. While the tset command performs a complete type−specific terminal initialization, stty sets individual terminal characteristics. The command syntax is: stty option [value] where the most common options are: Option Meaning Example n Baud−rate 9600 rows n Lines on the screen rows 36 columns n Columns on the screen columns 80 erase c Set the delete previous character to c erase h kill c Set the erase command character to c kill u intr c Set the interrupt character to c intr c eof c Set the end−of−file character to c eof d susp c Set the suspend job character to c susp z lnext c Set the literal next character to c lnext v werase c Set the word erase character to c werase w reprint c Set the reprint line character to c reprint r oddp Enable odd parity oddp evenp Enable even parity evenp −parity No parity is generated or detected −parity markp Enable mark parity markp cstopb Use two stop bits cstopb −cstopb Use one stop bit −cstopb 267 Note: Not all options require a value. The stty command may also be used to display the current terminal settings, for example: stty −a speed 9600 baud; line = 0; susp undef; dsusp undef rows = 24; columns = 80 intr = C; quit = \; erase = H; kill = U; swtch undef eof = D; eol = ; min = 4; time = 0; stop = S; start = Q parenb −parodd cs7 −cstopb hupcl −cread −clocal −loblk −crts −ignbrk brkint ignpar −parmrk −inpck istrip −inlcr −igncr icrnl −iuclc ixon −ixany ixoff −rtsxoff −ctsxon −ienqak isig icanon iexten −xcase echo echoe echok −echonl −noflsh opost −olcuc onlcr −ocrnl −onocr −onlret −ofill −ofdel −tostop On the BSD platform the same command has the format: stty everything The displayed data could be different from that specified in the termcap or terminfo databases. While the termcap and terminfo databases provide generic information about a terminal type befitting all terminals of a given type, stty provides information about the current setting for a specified terminal. The most common character to set with stty setting is the erase character. When logging from different places, a user can sometimes face the problem of which key to use to erase the last entered character the most common are the Backspace, Delete, or Control−Backspace keys. The preferred erase character can be set from the command line on any type of terminal, simply by typing: stty erase [desired erase key] The erase character will be set appropriately and can be used in the familiar way. The stty command can be used to set the erase character separately in the users login script, .profile, or .login to avoid such surprises: ..... To set Backspace as the erase character stty erase H .... If vi is used to edit the login script, the sequence v,h Ctrl−v, Ctrl−h should be typed to specify H Ctrl−H.

11.3 Pseudo Terminals