aboutsummaryrefslogtreecommitdiff
path: root/coreutils-5.3.0-bin/man/cat1p/stty.1p.txt
blob: 0a153663da1dd4c9fb299ee918cf5cb0675617af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
stty(P)                                                 stty(P)





NAME
       stty - set the options for a terminal

SYNOPSIS
       stty [ -a| -g]

       stty operands


DESCRIPTION
       The  stty  utility  shall  set or report on terminal I/O
       characteristics for the  device  that  is  its  standard
       input.  Without  options or operands specified, it shall
       report the settings of certain characteristics,  usually
       those  that differ from implementation-defined defaults.
       Otherwise, it shall modify the terminal state  according
       to  the  specified  operands. Detailed information about
       the modes listed in the  first  five  groups  below  are
       described    in   the   Base   Definitions   volume   of
       IEEE Std 1003.1-2001,  Chapter  11,   General   Terminal
       Interface.  Operands in the Combination Modes group (see
       Combination Modes ) are implemented  using  operands  in
       the  previous  groups. Some combinations of operands are
       mutually-exclusive on some terminal types;  the  results
       of using such combinations are unspecified.

       Typical implementations of this utility require a commu-
       nications line configured to use the  termios  interface
       defined    in    the   System   Interfaces   volume   of
       IEEE Std 1003.1-2001. On systems  where  none  of  these
       lines  are available, and on lines not currently config-
       ured to support the termios interface, some of the oper-
       ands need not affect terminal characteristics.

OPTIONS
       The  stty  utility shall conform to the Base Definitions
       volume of IEEE Std 1003.1-2001,  Section  12.2,  Utility
       Syntax Guidelines.

       The following options shall be supported:

       -a     Write to standard output all the current settings
              for the terminal.

       -g     Write to standard output all the current settings
              in  an unspecified form that can be used as argu-
              ments to another invocation of the  stty  utility
              on  the same system. The form used shall not con-
              tain any characters that would require quoting to
              avoid  word  expansion  by  the  shell;  see Word
              Expansions .


OPERANDS
       The following operands shall be  supported  to  set  the
       terminal characteristics.

   Control Modes
       parenb  (-parenb)
              Enable (disable) parity generation and detection.
              This shall have the effect of setting  (not  set-
              ting)  PARENB  in  the  termios c_cflag field, as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,    Chapter    11,   General
              Terminal Interface.

       parodd  (-parodd)

              Select odd (even) parity.  This  shall  have  the
              effect  of  setting  (not  setting) PARODD in the
              termios c_cflag field, as  defined  in  the  Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       cs5 cs6 cs7 cs8
              Select character size, if  possible.  This  shall
              have  the  effect  of  setting CS5, CS6, CS7, and
              CS8, respectively, in the termios c_cflag  field,
              as  defined  in  the  Base  Definitions volume of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       number Set  terminal  baud  rate to the number given, if
              possible. If the baud rate is set  to  zero,  the
              modem  control lines shall no longer be asserted.
              This shall have the effect of setting  the  input
              and output termios baud rate values as defined in
              the     Base      Definitions      volume      of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       ispeed  number
              Set terminal input baud rate to the number given,
              if  possible.  If  the  input baud rate is set to
              zero, the input baud rate shall be  specified  by
              the  value  of  the  output baud rate. This shall
              have the effect of setting the input termios baud
              rate  values  as  defined in the Base Definitions
              volume of IEEE Std 1003.1-2001, Chapter 11,  Gen-
              eral Terminal Interface.

       ospeed  number
              Set  terminal  output  baud  rate  to  the number
              given, if possible. If the output  baud  rate  is
              set  to  zero,  the  modem control lines shall no
              longer be asserted. This shall have the effect of
              setting  the  output  termios baud rate values as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       hupcl  (-hupcl)
              Stop asserting modem control lines (do  not  stop
              asserting  modem  control  lines)  on last close.
              This shall have the effect of setting  (not  set-
              ting)  HUPCL  in  the  termios  c_cflag field, as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       hup  (-hup)
              Equivalent to hupcl( -hupcl).

       cstopb  (-cstopb)
              Use two (one) stop bits per character. This shall
              have  the  effect of setting (not setting) CSTOPB
              in the termios c_cflag field, as defined  in  the
              Base  Definitions volume of IEEE Std 1003.1-2001,
              Chapter 11, General Terminal Interface.

       cread  (-cread)
              Enable (disable) the receiver.  This  shall  have
              the  effect of setting (not setting) CREAD in the
              termios c_cflag field, as  defined  in  the  Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       clocal  (-clocal)
              Assume a line without (with) modem control.  This
              shall  have  the  effect of setting (not setting)
              CLOCAL in the termios c_cflag field,  as  defined
              in     the    Base    Definitions    volume    of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.


       It  is unspecified whether stty shall report an error if
       an attempt to set a Control Mode fails.

   Input Modes
       ignbrk  (-ignbrk)
              Ignore (do not ignore) break on input. This shall
              have  the  effect of setting (not setting) IGNBRK
              in the termios c_iflag field, as defined  in  the
              Base  Definitions volume of IEEE Std 1003.1-2001,
              Chapter 11, General Terminal Interface.

       brkint  (-brkint)
              Signal (do not signal) INTR on break. This  shall
              have  the  effect of setting (not setting) BRKINT
              in the termios c_iflag field, as defined  in  the
              Base  Definitions volume of IEEE Std 1003.1-2001,
              Chapter 11, General Terminal Interface.

       ignpar  (-ignpar)
              Ignore (do not ignore) bytes with parity  errors.
              This  shall  have the effect of setting (not set-
              ting) IGNPAR in the  termios  c_iflag  field,  as
              defined   in   the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       parmrk  (-parmrk)

              Mark (do not mark) parity errors. This shall have
              the effect of setting (not setting) PARMRK in the
              termios  c_iflag  field,  as  defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       inpck  (-inpck)
              Enable  (disable)  input  parity  checking.  This
              shall have the effect of  setting  (not  setting)
              INPCK in the termios c_iflag field, as defined in
              the     Base      Definitions      volume      of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       istrip  (-istrip)
              Strip (do not strip) input  characters  to  seven
              bits.  This shall have the effect of setting (not
              setting) ISTRIP in the termios c_iflag field,  as
              defined   in   the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       inlcr  (-inlcr)
              Map  (do  not  map) NL to CR on input. This shall
              have the effect of setting (not setting) INLCR in
              the termios c_iflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       igncr (-igncr)
              Ignore  (do  not  ignore) CR on input. This shall
              have the effect of setting (not setting) IGNCR in
              the termios c_iflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       icrnl  (-icrnl)
              Map  (do  not  map) CR to NL on input. This shall
              have the effect of setting (not setting) ICRNL in
              the termios c_iflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       ixon  (-ixon)
              Enable  (disable) START/STOP output control. Out-
              put from the system is stopped  when  the  system
              receives   STOP   and  started  when  the  system
              receives START. This shall  have  the  effect  of
              setting (not setting) IXON in the termios c_iflag
              field, as defined in the Base Definitions  volume
              of IEEE Std 1003.1-2001, Chapter 11, General Ter-
              minal Interface.

       ixany  (-ixany)
              Allow any character to restart output. This shall
              have the effect of setting (not setting) IXANY in
              the termios c_iflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       ixoff  (-ixoff)
              Request that the  system  send  (not  send)  STOP
              characters  when  the  input queue is nearly full
              and START characters to resume data transmission.
              This  shall  have the effect of setting (not set-
              ting) IXOFF in  the  termios  c_iflag  field,  as
              defined   in   the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.


   Output Modes
       opost  (-opost)
              Post-process  output (do not post-process output;
              ignore all other output modes). This  shall  have
              the  effect of setting (not setting) OPOST in the
              termios c_oflag field, as  defined  in  the  Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       ocrnl  (-ocrnl)
              Map (do not map) CR to NL on  output  This  shall
              have the effect of setting (not setting) OCRNL in
              the termios c_oflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       onocr  (-onocr)
              Do not (do) output CR at column zero. This  shall
              have the effect of setting (not setting) ONOCR in
              the termios c_oflag field, as defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       onlret  (-onlret)
              The terminal newline key performs (does not  per-
              form)  the  CR  function.   This  shall  have the
              effect of setting (not  setting)  ONLRET  in  the
              termios  c_oflag  field,  as  defined in the Base
              Definitions   volume   of   IEEE Std 1003.1-2001,
              Chapter 11, General Terminal Interface.

       ofill  (-ofill)
              Use fill characters (use timing) for delays. This
              shall have the effect of  setting  (not  setting)
              OFILL in the termios c_oflag field, as defined in
              the     Base      Definitions      volume      of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       ofdel  (-ofdel)
              Fill characters are DELs (NULs). This shall  have
              the  effect of setting (not setting) OFDEL in the
              termios c_oflag field, as  defined  in  the  Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       cr0 cr1 cr2 cr3
              Select the style of delay  for  CRs.  This  shall
              have  the  effect  of  setting CRDLY to CR0, CR1,
              CR2, or CR3, respectively, in the termios c_oflag
              field,  as defined in the Base Definitions volume
              of IEEE Std 1003.1-2001, Chapter 11, General Ter-
              minal Interface.

       nl0 nl1
              Select the style of delay for NL. This shall have
              the effect  of  setting  NLDLY  to  NL0  or  NL1,
              respectively,  in  the  termios c_oflag field, as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       tab0 tab1 tab2 tab3

              Select the style of delay  for  horizontal  tabs.
              This  shall  have the effect of setting TABDLY to
              TAB0, TAB1, TAB2, or TAB3, respectively,  in  the
              termios  c_oflag  field,  as  defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter  11,  General  Terminal  Interface. Note that
              TAB3  has  the  effect  of  expanding  <tab>s  to
              <space>s.

       tabs  (-tabs)
              Synonym for tab0 ( tab3).

       bs0 bs1
              Select  the  style  of delay for backspaces. This
              shall have the effect of setting BSDLY to BS0  or
              BS1,  respectively, in the termios c_oflag field,
              as defined in  the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       ff0 ff1
              Select the style of delay  for  form-feeds.  This
              shall  have the effect of setting FFDLY to FF0 or
              FF1, respectively, in the termios c_oflag  field,
              as  defined  in  the  Base  Definitions volume of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       vt0 vt1
              Select the style of delay for vertical-tabs. This
              shall have the effect of setting VTDLY to VT0  or
              VT1,  respectively, in the termios c_oflag field,
              as defined in  the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.


   Local Modes
       isig  (-isig)
              Enable  (disable)  the  checking  of   characters
              against  the  special  control  characters  INTR,
              QUIT, and SUSP. This shall  have  the  effect  of
              setting (not setting) ISIG in the termios c_lflag
              field, as defined in the Base Definitions  volume
              of IEEE Std 1003.1-2001, Chapter 11, General Ter-
              minal Interface.

       icanon  (-icanon)
              Enable (disable) canonical input (ERASE and  KILL
              processing).  This  shall have the effect of set-
              ting (not setting) ICANON in the termios  c_lflag
              field,  as defined in the Base Definitions volume
              of IEEE Std 1003.1-2001, Chapter 11, General Ter-
              minal Interface.

       iexten  (-iexten)
              Enable  (disable) any implementation-defined spe-
              cial control characters not currently  controlled
              by  icanon, isig, ixon, or ixoff. This shall have
              the effect of setting (not setting) IEXTEN in the
              termios  c_lflag  field,  as  defined in the Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       echo  (-echo)
              Echo  back  (do  not  echo  back) every character
              typed. This shall have the effect of setting (not
              setting)  ECHO  in  the termios c_lflag field, as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       echoe  (-echoe)
              The ERASE character  visually  erases  (does  not
              erase)  the  last  character  in the current line
              from the display, if possible.  This  shall  have
              the  effect of setting (not setting) ECHOE in the
              termios c_lflag field, as  defined  in  the  Base
              Definitions volume of IEEE Std 1003.1-2001, Chap-
              ter 11, General Terminal Interface.

       echok  (-echok)
              Echo (do not echo) NL after KILL character.  This
              shall  have  the  effect of setting (not setting)
              ECHOK in the termios c_lflag field, as defined in
              the      Base      Definitions      volume     of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       echonl  (-echonl)
              Echo  (do not echo) NL, even if echo is disabled.
              This shall have the effect of setting  (not  set-
              ting)  ECHONL  in  the  termios c_lflag field, as
              defined  in  the  Base  Definitions   volume   of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface.

       noflsh  (-noflsh)
              Disable (enable) flush after  INTR,  QUIT,  SUSP.
              This  shall  have the effect of setting (not set-
              ting) NOFLSH in the  termios  c_lflag  field,  as
              defined   in   the  Base  Definitions  volume  of
              IEEE Std 1003.1-2001, Chapter 11, General  Termi-
              nal Interface.

       tostop  (-tostop)
              Send  SIGTTOU  for  background output. This shall
              have the effect of setting (not  setting)  TOSTOP
              in  the  termios c_lflag field, as defined in the
              Base Definitions volume of  IEEE Std 1003.1-2001,
              Chapter 11, General Terminal Interface.


   Special Control Character Assignments
       <control>-character string

              Set   <control>-character  to  string.  If  <con-
              trol>-character is one of the character sequences
              in  the  first column of the following table, the
              corresponding   Base   Definitions   volume    of
              IEEE Std 1003.1-2001,  Chapter 11, General Termi-
              nal Interface control character from  the  second
              column  shall  be recognized. This has the effect
              of  setting  the  corresponding  element  of  the
              termios c_cc array (see the Base Definitions vol-
              ume of IEEE Std 1003.1-2001, Chapter 13, Headers,
              <termios.h>).
              Table: Control Character Names in stty
Control Character     c_cc Subscript     Description
eof                   VEOF               EOF character
eol                   VEOL               EOL character
erase                 VERASE             ERASE character
intr                  VINTR              INTR character
kill                  VKILL              KILL character
quit                  VQUIT              QUIT character
susp                  VSUSP              SUSP character
start                 VSTART             START character
stop                  VSTOP              STOP character

       If  string  is a single character, the control character
       shall be set to that character. If string  is  the  two-
       character sequence "^-" or the string undef, the control
       character shall be set to _POSIX_VDISABLE , if it is  in
       effect  for  the  device;  if  _POSIX_VDISABLE is not in
       effect for the device, it shall be treated as an  error.
       In  the  POSIX  locale,  if  string  is  a two-character
       sequence beginning with circumflex ( '^' ), and the sec-
       ond  character is one of those listed in the "^c" column
       of the following table, the control character  shall  be
       set  to  the  corresponding character value in the Value
       column of the table.  Table: Circumflex Control  Charac-
       ters in stty
   ^c       Value     ^c       Value     ^c       Value
   a, A     <SOH>     l, L     <FF>      w, W     <ETB>
   b, B     <STX>     m, M     <CR>      x, X     <CAN>
   c, C     <ETX>     n, N     <SO>      y, Y     <EM>
   d, D     <EOT>     o, O     <SI>      z, Z     <SUB>
   e, E     <ENQ>     p, P     <DLE>     [        <ESC>
   f, F     <ACK>     q, Q     <DC1>     \        <FS>
   g, G     <BEL>     r, R     <DC2>     ]        <GS>
   h, H     <BS>      s, S     <DC3>     ^        <RS>
   i, I     <HT>      t, T     <DC4>     _        <US>
   j, J     <LF>      u, U     <NAK>     ?        <DEL>
   k, K     <VT>      v, V     <SYN>

       min  number

              Set  the  value  of MIN to number. MIN is used in
              non-canonical mode input processing ( icanon).

       time  number

              Set the value of TIME to number. TIME is used  in
              non-canonical mode input processing ( icanon).


   Combination Modes
       saved settings

              Set  the  current terminal characteristics to the
              saved settings produced by the -g option.

       evenp or parity

              Enable parenb and cs7; disable parodd.

       oddp

              Enable parenb, cs7, and parodd.

       -parity, -evenp, or -oddp

              Disable parenb, and set cs8.

       raw  (-raw or cooked)

              Enable (disable) raw input and output.  Raw  mode
              shall be equivalent to setting:


              stty cs8 erase ^- kill ^- intr ^- \
                  quit ^- eof ^- eol ^- -post -inpck

       nl  (-nl)

              Disable  (enable)  icrnl. In addition, -nl unsets
              inlcr and igncr.

       ek     Reset ERASE and KILL characters  back  to  system
              defaults.

       sane

              Reset  all modes to some reasonable, unspecified,
              values.


STDIN
       Although no input is read from standard input,  standard
       input  shall  be  used  to  get the current terminal I/O
       characteristics and to set new terminal I/O characteris-
       tics.

INPUT FILES
       None.

ENVIRONMENT VARIABLES
       The  following  environment  variables  shall affect the
       execution of stty:

       LANG   Provide a default value for the internationaliza-
              tion  variables  that are unset or null. (See the
              Base Definitions volume of  IEEE Std 1003.1-2001,
              Section  8.2,  Internationalization Variables for
              the precedence of internationalization  variables
              used  to  determine  the  values  of locale cate-
              gories.)

       LC_ALL If set to a non-empty string value, override  the
              values  of  all  the  other  internationalization
              variables.

       LC_CTYPE
              This  variable  determines  the  locale  for  the
              interpretation of sequences of bytes of text data
              as  characters  (for  example,   single-byte   as
              opposed  to  multi-byte  characters in arguments)
              and which characters are in the class print.

       LC_MESSAGES
              Determine the  locale  that  should  be  used  to
              affect the format and contents of diagnostic mes-
              sages written to standard error.

       NLSPATH
              Determine the location of  message  catalogs  for
              the processing of LC_MESSAGES .


ASYNCHRONOUS EVENTS
       Default.

STDOUT
       If  operands are specified, no output shall be produced.

       If the -g option is specified, stty shall write to stan-
       dard  output  the current settings in a form that can be
       used as arguments to another instance  of  stty  on  the
       same system.

       If the -a option is specified, all of the information as
       described in the OPERANDS section shall  be  written  to
       standard output. Unless otherwise specified, this infor-
       mation shall be written as <space>-separated  tokens  in
       an  unspecified  format,  on  one or more lines, with an
       unspecified  number  of  tokens  per  line.   Additional
       information may be written.

       If  no options or operands are specified, an unspecified
       subset of the information  written  for  the  -a  option
       shall be written.

       If  speed  information is written as part of the default
       output, or if the -a option is specified and if the ter-
       minal  input  speed  and  output speed are the same, the
       speed information shall be written as follows:


              "speed %d baud;", <speed>

       Otherwise, speeds shall be written as:


              "ispeed %d baud; ospeed %d baud;", <ispeed>, <ospeed>

       In locales other than the POSIX locale,  the  word  baud
       may  be  changed  to something more appropriate in those
       locales.

       If control characters are written as part of the default
       output,  or if the -a option is specified, control char-
       acters shall be written as:


              "%s = %s;", <control-character name>, <value>

       where <value> is either the character,  or  some  visual
       representation  of the character if it is non-printable,
       or the string undef if the character is disabled.

STDERR
       The standard error shall be  used  only  for  diagnostic
       messages.

OUTPUT FILES
       None.

EXTENDED DESCRIPTION
       None.

EXIT STATUS
       The following exit values shall be returned:

        0     The  terminal  options  were read or set success-
              fully.

       >0     An error occurred.


CONSEQUENCES OF ERRORS
       Default.

       The following sections are informative.

APPLICATION USAGE
       The -g flag is designed to  facilitate  the  saving  and
       restoring  of  terminal  state from the shell level. For
       example, a program may:


              saveterm="$(stty -g)"       # save terminal state
              stty (new settings)         # set new state
              ...                         # ...
              stty $saveterm              # restore terminal state

       Since the format is unspecified, the saved value is  not
       portable across systems.

       Since  the  -a  format  is so loosely specified, scripts
       that save and restore terminal settings should  use  the
       -g option.

EXAMPLES
       None.

RATIONALE
       The  original  stty  description was taken directly from
       System V and reflected  the  System  V  terminal  driver
       termio.   It has been modified to correspond to the ter-
       minal driver termios.

       Output modes are specified only for XSI-conformant  sys-
       tems.  All  implementations are expected to provide stty
       operands corresponding to all of the output  modes  they
       support.

       The  stty  utility  is primarily used to tailor the user
       interface of the terminal, such as  selecting  the  pre-
       ferred ERASE and KILL characters. As an application pro-
       gramming utility, stty can be used within shell  scripts
       to  alter  the terminal settings for the duration of the
       script.

       The termios section states that individual disabling  of
       control   characters  is  possible  through  the  option
       _POSIX_VDISABLE. If enabled, two  conventions  currently
       exist  for specifying this: System V uses "^-" , and BSD
       uses undef. Both are accepted by stty in this volume  of
       IEEE Std 1003.1-2001.  The other BSD convention of using
       the letter 'u' was rejected because  it  conflicts  with
       the actual letter 'u' , which is an acceptable value for
       a control character.

       Early proposals did not specify the mapping of  "^c"  to
       control  characters  because the control characters were
       not specified in the POSIX locale character set descrip-
       tion  file  requirements.   The control character set is
       now  specified  in  the  Base  Definitions   volume   of
       IEEE Std 1003.1-2001, Chapter 3, Definitions so the his-
       torical mapping is specified.  Note  that  although  the
       mapping corresponds to control-character key assignments
       on many terminals that use the ISO/IEC 646:1991 standard
       (or  ASCII)  character  encodings, the mapping specified
       here is to the control characters,  not  their  keyboard
       encodings.

       Since  termios  supports  separate  speeds for input and
       output, two new options were added to specify each  dis-
       tinctly.

       Some  historical  implementations  use standard input to
       get and set terminal characteristics; others  use  stan-
       dard  output.  Since  input  from a login TTY is usually
       restricted to the owner while output to a  TTY  is  fre-
       quently  open  to  anyone, using standard input provides
       fewer chances of accidentally (or maliciously)  altering
       the  terminal  settings  of  other users. Using standard
       input also allows stty -a and stty -g output to be redi-
       rected for later use. Therefore, usage of standard input
       is required by this volume of IEEE Std 1003.1-2001.

FUTURE DIRECTIONS
       None.

SEE ALSO
       Shell Command Language , the Base Definitions volume  of
       IEEE Std 1003.1-2001,   Chapter   11,  General  Terminal
       Interface, <termios.h>

COPYRIGHT
       Portions of this text are reprinted  and  reproduced  in
       electronic  form  from  IEEE  Std  1003.1, 2003 Edition,
       Standard for Information Technology -- Portable  Operat-
       ing System Interface (POSIX), The Open Group Base Speci-
       fications Issue 6, Copyright (C) 2001-2003 by the Insti-
       tute  of  Electrical  and Electronics Engineers, Inc and
       The Open Group. In the event of any discrepancy  between
       this  version  and  the original IEEE and The Open Group
       Standard, the original IEEE and The Open Group  Standard
       is  the  referee  document. The original Standard can be
       obtained        online        at        http://www.open-
       group.org/unix/online.html .



POSIX                         2003                      stty(P)