Bash stty a speed 9600 baud rows 36 columns 96 line 0

This preview shows page 255 - 257 out of 634 pages.

bash$stty -aspeed 9600 baud; rows 36; columns 96; line = 0;intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;...isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprtUsing canonical mode, it is possible to redefine the special keys for the local terminal line editor.bash$cat > filexxxwha<ctl-W>I<ctl-H>foo bar<ctl-U>hello world<ENTER><ctl-D>bash$cat filexxxhello worldbash$bash$ wc -c < file13The process controlling the terminal receives only 13 characters (12 alphabetic ones, plus a newline),although the user hit 26 keys.In non-canonical ("raw") mode, every key hit (including special editing keys such asctl-H) sends acharacter immediately to the controlling process.The Bash prompt disables bothicanonandecho, since it replaces the basic terminal line editor with itsown more elaborate one. For example, when you hitctl-Aat the Bash prompt, there's no^Aechoed bythe terminal, but Bash gets a\1character, interprets it, and moves the cursor to the begining of the line.Stephané ChazelassettermSet certain terminal attributes. This command writes to its terminal'sstdouta string that changesthe behavior of that terminal.bash$setterm -cursor offbash$Thesettermcommand can be used within a script to change the appearance of text written tostdout, although there are certainly better tools available for this purpose.Advanced Bash-Scripting GuideChapter 13. System and Administrative Commands250
setterm -bold onecho bold hellosetterm -bold offecho normal hellotsetShow or initialize terminal settings. This is a less capable version ofstty.bash$tset -rTerminal type is xterm-xfree86.Kill is control-U (^U).Interrupt is control-C (^C).setserialSet or display serial port parameters. This command must be run by root user and is usually found in asystem setup script.# From /etc/pcmcia/serial script:IRQ=`setserial /dev/$DEVICE | sed -e 's/.*IRQ: //'`setserial /dev/$DEVICE irq 0 ; setserial /dev/$DEVICE irq $IRQgetty,agettyThe initialization process for a terminal usesgettyoragettyto set it up for login by a user. Thesecommands are not used within user shell scripts. Their scripting counterpart isstty.mesgEnables or disables write access to the current user's terminal. Disabling access would prevent anotheruser on the network to write to the terminal.It can be very annoying to have a message about ordering pizza suddenly appear in themiddle of the text file you are editing. On a multi-user network, you might thereforewish to disable write access to your terminal when you need to avoid interruptions.wallThis is an acronym for "write all", i.e., sending a message to all users at every terminal logged into thenetwork. It is primarily a system administrator's tool, useful, for example, when warning everyonethat the system will shortly go down due to a problem (see Example 17-1).

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 634 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Leachman
Tags
Beowulf, The Land, scripting language, Shell script, C shell

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture