summaryrefslogtreecommitdiff
path: root/doc/article.pt.ps
blob: 875a04e64725ffe0e1775cff591f0accc88703ad (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
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
%!PS-Adobe-3.0
%%Creator: groff version 1.08
%%DocumentNeededResources: font Palatino-Bold
%%+ font Palatino-Italic
%%+ font Palatino-Roman
%%+ font Courier
%%DocumentSuppliedResources: procset grops 1.08 0
%%Pages: 12
%%PageOrder: Ascend
%%Orientation: Portrait
%%EndComments
%%BeginProlog
%%BeginResource: procset grops 1.08 0
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll 
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}bind def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/FL{
currentgray exch setgray fill setgray
}bind def
/BL/fill load def
/LW/setlinewidth load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
}bind def
/PEND{
clear
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%IncludeResource: font Palatino-Bold
%%IncludeResource: font Palatino-Italic
%%IncludeResource: font Palatino-Roman
%%IncludeResource: font Courier
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
/udieresis/yacute/thorn/ydieresis]def/Courier@0 ENC0/Courier RE
/Palatino-Roman@0 ENC0/Palatino-Roman RE/Palatino-Italic@0 ENC0/Palatino-Italic
RE/Palatino-Bold@0 ENC0/Palatino-Bold RE
%%EndProlog
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 12/Palatino-Bold@0 SF(Bash \255 The GNU shell*)223.71 120 Q/F1 10
/Palatino-Italic@0 SF(Chet Ramey)263.415 144 Q(Case W)220.45 156 Q
(estern Reserve University)-.2 E(chet@po.cwru.edu)251.305 168 Q/F2 10
/Palatino-Bold@0 SF 2.5(1. Introduction)72 234 R(Bash)97 249.6 Q/F3 10
/Palatino-Roman@0 SF .551(is the shell, or command language interpr)3.051 F
(eter)-.18 E 3.051(,t)-.74 G .55(hat will appear in the GNU operating)334.708
249.6 R 4.36(system. The)72 261.6 R 1.86(name is an acr)4.36 F 1.861
(onym for the `)-.18 F 1.861(`Bourne-Again SHell')-.37 F 1.861
(', a pun on Steve Bourne, the)-.37 F 1.274(author of the dir)72 273.6 R 1.274
(ect ancestor of the curr)-.18 F(ent)-.18 E/F4 9/Palatino-Roman@0 SF(UNIX)3.774
E F3 3.773<8773>C(hell)307.862 273.6 Q F1(/bin/sh)3.773 E F3 3.773(,w)C 1.273
(hich appear)370.458 273.6 R 1.273(ed in the Seventh)-.18 F
(Edition Bell Labs Resear)72 285.6 Q(ch version of)-.18 E F4(UNIX)2.5 E F3(.)A
.925(Bash is an)97 301.2 R F2(sh)3.425 E F3 .925
(\255compatible shell that incorporates useful featur)B .926(es fr)-.18 F .926
(om the Korn shell \()-.18 F F2(ksh)A F3(\))A .737(and the C shell \()72 313.2
R F2(csh)A F3 .737(\), described later in this article.)B .737
(It is ultimately intended to be a conformant)5.737 F .278
(implementation of the IEEE POSIX Shell and Utilities speci\214cation \(IEEE W)
72 325.2 R .279(orking Gr)-.92 F .279(oup 1003.2\).)-.18 F(It of)72 337.2 Q
(fers functional impr)-.18 E(ovements over sh for both interactive and pr)-.18
E(ogramming use.)-.18 E 1.299(While the GNU operating system will most likely \
include a version of the Berkeley shell)97 352.8 R .527
(csh, Bash will be the default shell.)72 364.8 R .527(Like other GNU softwar)
5.527 F .527(e, Bash is quite portable.)-.18 F .527(It curr)5.527 F(ently)-.18
E -.08(ru)72 376.8 S 1.391(ns on nearly every version of).08 F F4(UNIX)3.891 E
F3 1.391(and a few other operating systems \255 an independently-)3.891 F .278
(supported port exists for OS/2, and ther)72 388.8 R 2.779(ea)-.18 G .639 -.18
(re r)264.36 388.8 T .279(umors of ports to DOS and W).1 F .279(indows NT)-.55
F 5.279(.P)-.74 G .279(orts to)475.591 388.8 R F4(UNIX)72 400.8 Q F3
(-like systems such as QNX and Minix ar)A 2.5(ep)-.18 G
(art of the distribution.)285.547 400.8 Q .897
(The original author of Bash was Brian Fox, an employee of the Fr)97 416.4 R
.896(ee Softwar)-.18 F 3.396(eF)-.18 G(oundation.)455.63 416.4 Q 1.287
(The curr)72 428.4 R 1.287(ent developer and maintainer is Chet Ramey)-.18 F
3.787(,av)-1.11 G 1.287(olunteer who works at Case W)335.573 428.4 R(estern)
-.92 E(Reserve University)72 440.4 Q(.)-1.11 E F2 2.5(2. What')72 464.4 R 2.5
(sP)-.55 G(OSIX, anyway?)124.22 464.4 Q F1(POSIX)97 480 Q F3 .947
(is a name originally coined by Richar)5.113 F 3.447(dS)-.18 G .947
(tallman for a family of open system stan-)316.422 480 R(dar)72 492 Q .644
(ds based on)-.18 F F4(UNIX)3.144 E F3 5.644(.T)C(her)181.403 492 Q 3.144(ea)
-.18 G 1.004 -.18(re a n)208.717 492 T .644(umber of aspects of).18 F F4(UNIX)
3.145 E F3 .645(under consideration for standar)3.145 F(d-)-.18 E .814
(ization, fr)72 504 R .814(om the basic system services at the system call and\
 C library level to applications and)-.18 F 1.191
(tools to system administration and management.)72 516 R 1.192(Each ar)6.191 F
1.192(ea of standar)-.18 F 1.192(dization is assigned to a)-.18 F(working gr)72
528 Q(oup in the 1003 series.)-.18 E .426
(The POSIX Shell and Utilities standar)97 543.6 R 2.926(dh)-.18 G .426
(as been developed by IEEE W)279.198 543.6 R .426(orking Gr)-.92 F .426
(oup 1003.2)-.18 F .238
(\(POSIX.2\).\210 It concentrates on the command interpr)72 555.6 R .238
(eter interface and utility pr)-.18 F .238(ograms commonly)-.18 F 1.212
(executed fr)72 567.6 R 1.212(om the command line or by other pr)-.18 F 3.712
(ograms. An)-.18 F 1.212(initial version of the standar)3.712 F 3.712(dh)-.18 G
(as)494.76 567.6 Q .695(been appr)72 579.6 R .695
(oved and published by the IEEE, and work is curr)-.18 F .694
(ently underway to update it.)-.18 F(Ther)5.694 E(e)-.18 E(ar)72 591.6 Q 2.5
(ef)-.18 G(our primary ar)91.39 591.6 Q(eas of work in the 1003.2 standar)-.18
E(d:)-.18 E 18.94<8341>72 607.2 S .397
(spects of the shell's syntax and command language.)104.78 607.2 R 2.897(An)
5.397 G .397(umber of special builtins such as)357.913 607.2 R F2(cd)97 619.2 Q
F3(and)3.144 E F2(exec)3.144 E F3(ar)3.144 E 3.144(eb)-.18 G .644(eing speci\
\214ed as part of the shell, since their functionality usually cannot)175.586
619.2 R(be implemented by a separate executable;)97 631.2 Q 18.94<8341>72 646.8
S .661(set of utilities to be called by shell scripts and applications.)107.94
646.8 R .661(Examples ar)5.661 F 3.161(ep)-.18 G -.18(ro)447.859 646.8 S .661
(grams like).18 F F1 3.472(sed, tr)97 658.8 R(,)-.74 E F3(and)5.972 E F1(awk.)
4.306 E F3 1.806(Utilities commonly implemented as shell builtins ar)5.972 F
4.305(ed)-.18 G 1.805(escribed in this)433.67 658.8 R .32 LW 76 668.8 72 668.8
DL 80 668.8 76 668.8 DL 84 668.8 80 668.8 DL 88 668.8 84 668.8 DL 92 668.8 88
668.8 DL 96 668.8 92 668.8 DL 100 668.8 96 668.8 DL 104 668.8 100 668.8 DL 108
668.8 104 668.8 DL 112 668.8 108 668.8 DL 116 668.8 112 668.8 DL 120 668.8 116
668.8 DL 124 668.8 120 668.8 DL 128 668.8 124 668.8 DL 132 668.8 128 668.8 DL
136 668.8 132 668.8 DL 140 668.8 136 668.8 DL 144 668.8 140 668.8 DL/F5 8
/Palatino-Roman@0 SF(*An earlier version of this article appear)72 678.8 Q
(ed in The Linux Journal.)-.144 E<87>72 688.8 Q/F6 7/Palatino-Roman@0 SF(UNIX)2
E F5(is a trademark of Bell Laboratories.)2 E(\210IEEE,)72 698.8 Q/F7 8
/Palatino-Italic@0 SF 1.14(IEEE Standard for Information T)3.14 F 1.141
(echnology -- Portable Operating System Interface \(POSIX\) Part 2: Shell and)
-.888 F(Utilities)72 708.8 Q F5 2(,1)C(992.)106.672 708.8 Q EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-2-)279.67 48 S .638(section, such as)97 84 R/F1
10/Palatino-Bold@0 SF(test)3.138 E F0(and)3.138 E F1(kill)3.138 E F0 5.638(.A)C
3.138(ne)240.928 84 S .638
(xpansion of this section's scope, termed the User Porta-)254.676 84 R
(bility Extension, or UPE, has standar)97 96 Q(dized interactive pr)-.18 E
(ograms such as)-.18 E/F2 10/Palatino-Italic@0 SF(vi)2.5 E F0(and)4.166 E F2
(mailx;)2.5 E F0 18.94<8341>72 111.6 S(gr)108.58 111.6 Q 1.3
(oup of functional interfaces to services pr)-.18 F 1.299
(ovided by the shell, such as the traditional)-.18 F/F3 10/Courier@0 SF
(system\(\))97 123.6 Q F0 3.385(Cl)3.385 G .885(ibrary function.)161.77 123.6 R
(Ther)5.885 E 3.385(ea)-.18 G 1.245 -.18(re f)271.195 123.6 T .885
(unctions to perform shell wor).18 F 3.385(de)-.18 G .885(xpansions, per)
435.555 123.6 R(-)-.18 E 1.945(form \214lename expansion \()97 135.6 R F2
(globbing)A F0 1.945(\), obtain values of POSIX.2 system con\214guration vari-)
B(ables, r)97 147.6 Q(etrieve values of envir)-.18 E(onment variables \()-.18 E
F3(getenv\(\))A F0(\), and other services;).833 E 18.94<8341>72 163.2 S
(suite of `)107.28 163.2 Q(`development')-.37 E 2.5('u)-.37 G(tilities such as)
219.63 163.2 Q F2(c89)2.5 E F0(\(the POSIX.2 version of)4.166 E F2(cc)2.5 E F0
(\), and)A F2(yacc.)2.5 E F0 1.326(Bash is concerned with the aspects of the s\
hell's behavior de\214ned by POSIX.2.)97 178.8 R 1.326(The shell)6.326 F 1.156
(command language has of course been standar)72 190.8 R 1.156
(dized, including the basic \215ow contr)-.18 F 1.156(ol and pr)-.18 F(o-)-.18
E 1.168(gram execution constr)72 202.8 R 1.168(ucts, I/O r)-.08 F(edir)-.18 E
1.168(ection and pipelining, ar)-.18 F 1.168(gument handling, variable expan-)
-.18 F 1(sion, and quoting.)72 214.8 R(The)6 E F2(special)3.5 E F0 .999
(builtins, which must be implemented as part of the shell to pr)5.166 F(o-)-.18
E .698(vide the desir)72 226.8 R .698(ed functionality)-.18 F 3.198(,a)-1.11 G
1.059 -.18(re s)213.942 226.8 T .699
(peci\214ed as being part of the shell; examples of these ar).18 F(e)-.18 E F1
(eval)3.199 E F0(and)72 238.8 Q F1(export)3.339 E F0 5.839(.O)C .839(ther util\
ities appear in the sections of POSIX.2 not devoted to the shell which ar)
137.358 238.8 R(e)-.18 E .131(commonly \(and in some cases must be\) implement\
ed as builtin commands, such as)72 250.8 R F1(read)2.632 E F0(and)2.632 E F1
(test)2.632 E F0(.)A .408(POSIX.2 also speci\214es aspects of the shell's inte\
ractive behavior as part of the UPE, including job)72 262.8 R(contr)72 274.8 Q
1.726(ol and command line editing.)-.18 F(Inter)6.726 E 1.726
(estingly enough, only)-.18 F F2(vi)4.227 E F0 1.727
(-style line editing commands)B(have been standar)72 286.8 Q(dized;)-.18 E F2
(emacs)2.5 E F0(editing commands wer)2.5 E 2.5(el)-.18 G
(eft out due to objections.)321.07 286.8 Q .376
(While POSIX.2 includes much of what the shell has traditionally pr)97 302.4 R
.375(ovided, some important)-.18 F .183(things have been omitted as being `)72
314.4 R .183(`beyond its scope.')-.37 F 5.184('T)-.37 G(her)324.548 314.4 Q
2.684(ei)-.18 G .184(s, for instance, no mention of a dif-)349.312 314.4 R(fer)
72 326.4 Q 1.325(ence between a)-.18 F F2(login)3.825 E F0 1.325
(shell and any other interactive shell \(since POSIX.2 does not specify a)5.491
F .068(login pr)72 338.4 R 2.568(ogram\). No)-.18 F .068
(\214xed startup \214les ar)2.568 F 2.568(ed)-.18 G .068
(e\214ned, either \255 the standar)264.836 338.4 R 2.569(dd)-.18 G .069
(oes not mention)398.607 338.4 R F2(.pr)2.569 E(o\214le)-.18 E F0(.)1.666 E F1
2.5(3. Basic)72 362.4 R(Bash features)2.5 E F0 1.359(Since the Bourne shell pr)
97 378 R 1.358(ovides Bash with most of its philosophical underpinnings, Bash)
-.18 F .721(inherits most of its featur)72 390 R .721(es and functionality fr)
-.18 F .721(om sh.)-.18 F .722(Bash implements all of the traditional sh)5.721
F 1.342(\215ow contr)72 402 R 1.342(ol constr)-.18 F 1.342(ucts \()-.08 F F2
(for)A F0(,)A F2(if)3.842 E F0(,)A F2(while)3.842 E F0 3.842(,e)C 3.842
(tc.\). All)245.072 402 R 1.342
(of the Bourne shell builtins, including those not)3.842 F .034
(speci\214ed in the POSIX.2 standar)72 414 R .034(d, appear in Bash.)-.18 F
(Shell)5.034 E F2(functions)2.534 E F0 2.534(,i)C(ntr)368.5 414 Q .035
(oduced in the SVR2 version)-.18 F .237(of the Bourne shell, ar)72 426 R 2.736
(es)-.18 G .236(imilar to shell scripts, but ar)181.472 426 R 2.736(ed)-.18 G
.236(e\214ned using a special syntax and ar)319.828 426 R 2.736(ee)-.18 G(xe-)
490.72 426 Q .276(cuted in the same pr)72 438 R .276
(ocess as the calling shell.)-.18 F .277
(Bash has shell functions which behave in a fashion)5.276 F(upwar)72 450 Q .114
(d-compatible with sh functions.)-.18 F(Ther)5.114 E 2.614(ea)-.18 G .474 -.18
(re c)279.8 450 T .114(ertain shell variables that Bash interpr).18 F .113
(ets in the)-.18 F .975(same way as sh, such as)72 462 R F1(PS1)3.475 E F0(,)A
F1(IFS)3.475 E F0 3.475(,a)C(nd)235.91 462 Q F1 -.74(PA)3.475 G(TH)-.18 E F0
5.975(.B)C .976(ash implements essentially the same grammar)293.13 462 R(,)-.74
E .025(parameter and variable expansion semantics, r)72 474 R(edir)-.18 E .025
(ection, and quoting as the Bourne shell.)-.18 F(Wher)5.025 E(e)-.18 E(dif)72
486 Q(fer)-.18 E 2.74(ences appear between the POSIX.2 standar)-.18 F 5.24(da)
-.18 G 2.74(nd traditional sh behavior)314.53 486 R 5.24(,B)-.74 G 2.74
(ash follows)451.05 486 R(POSIX.)72 498 Q .494(The Korn Shell \()97 513.6 R F1
(ksh)A F0 2.994(\)i)C 2.994(sad)196.116 513.6 S .494
(escendent of the Bourne shell written at A)217.454 513.6 R .494
(T&T Bell Laboratories)-.74 F 1.435(by David Korn\207.)72 525.6 R 1.435(It pr)
6.435 F 1.435(ovides a number of useful featur)-.18 F 1.436
(es that POSIX and Bash have adopted.)-.18 F .87
(Many of the interactive facilities in POSIX.2 have their r)72 537.6 R .869
(oots in the ksh: for example, the POSIX)-.18 F .85(and ksh job contr)72 549.6
R .85(ol facilities ar)-.18 F 3.351(en)-.18 G .851
(early identical. Bash includes featur)225.181 549.6 R .851(es fr)-.18 F .851
(om the Korn Shell for)-.18 F .564(both interactive use and shell pr)72 561.6 R
3.063(ogramming. For)-.18 F(pr)3.063 E .563(ogramming, Bash pr)-.18 F .563
(ovides variables such as)-.18 F F1(RANDOM)72 573.6 Q F0(and)2.768 E F1(REPL)
2.768 E(Y)-.92 E F0 2.768(,t)C(he)184.284 573.6 Q F1(typeset)2.768 E F0 .268
(builtin, the ability to r)2.768 F .269(emove substrings fr)-.18 F .269
(om variables based)-.18 F .582(on patterns, and shell arithmetic.)72 585.6 R
F1(RANDOM)5.582 E F0 .581(expands to a random number each time it is r)3.081 F
(efer)-.18 E(-)-.18 E 2.583(enced; assigning a value to)72 597.6 R F1(RANDOM)
5.083 E F0 2.583(seeds the random number generator)5.083 F(.)-.74 E F1(REPL)
7.583 E(Y)-.92 E F0 2.584(is the)5.083 F .034(default variable used by the)72
609.6 R F1(read)2.534 E F0 .034(builtin when no variable names ar)2.534 F 2.534
(es)-.18 G .034(upplied as ar)383.348 609.6 R 2.534(guments. The)-.18 F F1
(typeset)72 621.6 Q F0 .416
(builtin is used to de\214ne variables and give them attributes such as)2.916 F
F1(readonly)2.916 E F0 5.416(.B)C .416(ash arith-)461.754 621.6 R 1.31
(metic allows the evaluation of an expr)72 633.6 R 1.31
(ession and the substitution of the r)-.18 F 3.81(esult. Shell)-.18 F
(variables)3.81 E .561(may be used as operands, and the r)72 645.6 R .561
(esult of an expr)-.18 F .561(ession may be assigned to a variable.)-.18 F
(Nearly)5.562 E(all of the operators fr)72 657.6 Q(om the C language ar)-.18 E
2.5(ea)-.18 G(vailable, with the same pr)271.68 657.6 Q(ecedence r)-.18 E
(ules:)-.08 E F3 6($e)97 675.6 S(cho $\(\(3 + 5 * 32\)\))115 675.6 Q(163)97
687.6 Q .32 LW 76 698 72 698 DL 80 698 76 698 DL 84 698 80 698 DL 88 698 84 698
DL 92 698 88 698 DL 96 698 92 698 DL 100 698 96 698 DL 104 698 100 698 DL 108
698 104 698 DL 112 698 108 698 DL 116 698 112 698 DL 120 698 116 698 DL 124 698
120 698 DL 128 698 124 698 DL 132 698 128 698 DL 136 698 132 698 DL 140 698 136
698 DL 144 698 140 698 DL/F4 8/Palatino-Roman@0 SF
(\207Morris Bolsky and David Korn,)72 708 Q/F5 8/Palatino-Italic@0 SF
(The KornShell Command and Pr)2 E(ogramming Language)-.144 E F4 2(,P)C -.144
(re)374.688 708 S(ntice Hall, 1989.).144 E EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-3-)279.67 48 S .953
(For interactive use, Bash implements ksh-style aliases and builtins such as)72
84 R/F1 10/Palatino-Bold@0 SF(fc)3.453 E F0 .953(\(discussed below\))3.453 F
(and)72 96 Q F1(jobs)2.603 E F0 5.103(.B)C .104
(ash aliases allow a string to be substituted for a command name.)124.686 96 R
.104(They can be used to)5.104 F(cr)72 108 Q .936(eate a mnemonic for a)-.18 F
/F2 9/Palatino-Roman@0 SF(UNIX)3.435 E F0 .935(command name \()3.435 F/F3 10
/Courier@0 SF .935(alias del=rm)B F0 .935(\), to expand a single wor)B 3.435
(dt)-.18 G 3.435(oa)490.105 108 S 1.465(complex command \()72 120 R F3 1.465
(alias news='xterm -g 80x45 -title trn -e trn -e -S1 -N)B(&')72 132 Q F0 .738
(\), or to ensur)B 3.238(et)-.18 G .737
(hat a command is invoked with a basic set of options \()153.612 132 R F3 .737
(alias ls="/bin/ls)B(-F")72 144 Q F0(\).)A .4(The C shell \()97 159.6 R F1(csh)
A F0 .401(\)\207, originally written by Bill Joy while at Berkeley)B 2.901(,i)
-1.11 G 2.901(sw)396.846 159.6 S .401(idely used and quite)412.327 159.6 R .002
(popular for its interactive facilities.)72 171.6 R .002
(Bash includes a csh-compatible history expansion mechanism)5.002 F(\(`)72
183.6 Q 2.058(`! history')-.37 F 2.058
('\), brace expansion, access to a stack of dir)-.37 F 2.058(ectories via the)
-.18 F F1(pushd)4.558 E F0(,)A F1(popd)4.558 E F0 4.558(,a)C(nd)469.742 183.6 Q
F1(dirs)4.558 E F0 .648
(builtins, and tilde expansion, to generate users' home dir)72 195.6 R 3.148
(ectories. T)-.18 F .647(ilde expansion has also been)-.55 F
(adopted by both the Korn Shell and POSIX.2.)72 207.6 Q(Ther)97 223.2 Q 2.98
(ew)-.18 G(er)133.62 223.2 Q 2.98(ec)-.18 G .48(ertain ar)154.39 223.2 R .48
(eas in which POSIX.2 felt standar)-.18 F .48(dization was necessary)-.18 F
2.98(,b)-1.11 G .48(ut no exist-)453.78 223.2 R 1.061(ing implementation pr)72
235.2 R 1.062(ovided the pr)-.18 F 1.062(oper behavior)-.18 F 6.062(.T)-.74 G
1.062(he working gr)312.43 235.2 R 1.062(oup invented and standar)-.18 F(d-)
-.18 E .279(ized functionality in these ar)72 247.2 R .279
(eas, which Bash implements.)-.18 F(The)5.278 E F1(command)2.778 E F0 .278
(builtin was invented so)2.778 F 1.376
(that shell functions could be written to r)72 259.2 R 1.376
(eplace builtins; it makes the capabilities of the builtin)-.18 F .477
(available to the function.)72 271.2 R .477(The r)5.477 F .477(eserved wor)-.18
F 2.977(d`)-.18 G(`!')278.12 271.2 Q 2.977('w)-.37 G .477
(as added to negate the r)300.187 271.2 R .477(eturn value of a com-)-.18 F
1.09(mand or pipeline; it was nearly impossible to expr)72 283.2 R 1.09(ess `)
-.18 F 1.09(`if not x')-.37 F 3.59('c)-.37 G 1.09
(leanly using the sh language.)370.99 283.2 R(Ther)72 295.2 Q 3.684(ee)-.18 G
1.183(xist multiple incompatible implementations of the)105.774 295.2 R F1
(test)3.683 E F0 1.183(builtin, which tests \214les for type)3.683 F .38
(and other attributes and performs arithmetic and string comparisons.)72 307.2
R .38(POSIX consider)5.38 F .38(ed none of)-.18 F .469(these corr)72 319.2 R
.468(ect, so the standar)-.18 F 2.968(db)-.18 G .468
(ehavior was speci\214ed in terms of the number of ar)210.762 319.2 R .468
(guments to the)-.18 F 2.52(command. POSIX.2)72 331.2 R .021
(dictates exactly what will happen when four or fewer ar)2.52 F .021
(guments ar)-.18 F 2.521(eg)-.18 G .021(iven to)473.589 331.2 R F1(test)72
343.2 Q F0 4.905(,a)C 2.405(nd leaves the behavior unde\214ned when mor)100.505
343.2 R 4.905(ea)-.18 G -.18(rg)325.27 343.2 S 2.404(uments ar).18 F 4.904(es)
-.18 G 4.904(upplied. Bash)395.178 343.2 R 2.404(uses the)4.904 F
(POSIX.2 algorithm, which was conceived by David Korn.)72 355.2 Q F1 2.5
(3.1. Features)72 379.2 R(not in the Bourne Shell)2.5 E F0(Ther)97 394.8 Q
3.958(ea)-.18 G 1.818 -.18(re a n)131.258 394.8 T 1.458(umber of minor dif).18
F(fer)-.18 E 1.458(ences between Bash and the version of sh pr)-.18 F 1.458
(esent on)-.18 F .503(most other versions of)72 406.8 R F2(UNIX)3.003 E F0
5.503(.T)C .503(he majority of these ar)212.582 406.8 R 3.002(ed)-.18 G .502
(ue to the POSIX standar)326.876 406.8 R .502(d, but some ar)-.18 F(e)-.18 E
1.173(the r)72 418.8 R 1.173(esult of Bash adopting featur)-.18 F 1.173(es fr)
-.18 F 1.173(om other shells.)-.18 F 1.174
(For instance, Bash includes the new `)6.173 F(`!')-.37 E(')-.37 E -.18(re)72
430.8 S .414(served wor).18 F .414(d, the)-.18 F F1(command)2.913 E F0 .413
(builtin, the ability of the)2.913 F F1(read)2.913 E F0 .413(builtin to corr)
2.913 F .413(ectly r)-.18 F .413(eturn a line end-)-.18 F 1.635
(ing with a backslash, symbolic ar)72 442.8 R 1.635(guments to the)-.18 F F1
(umask)4.135 E F0 1.636(builtin, variable substring r)4.136 F 1.636(emoval, a)
-.18 F .791(way to get the length of a variable, and the new algorithm for the)
72 454.8 R F1(test)3.29 E F0 .79(builtin fr)3.29 F .79(om the POSIX.2)-.18 F
(standar)72 466.8 Q(d, none of which appear in sh.)-.18 E 1.408
(Bash also implements the `)97 482.4 R(`$\(...\)')-.37 E 3.908('c)-.37 G 1.408
(ommand substitution syntax, which supersedes the sh)255.56 482.4 R .54
(`...` constr)72 494.4 R 3.04(uct. The)-.08 F -.37(``)3.04 G($\(...\)').37 E
3.04('c)-.37 G(onstr)193.76 494.4 Q .54
(uct expands to the output of the command contained within the)-.08 F(par)72
506.4 Q .708(entheses, with trailing newlines r)-.18 F 3.208(emoved. The)-.18 F
.709(sh syntax is accepted for backwar)3.208 F .709(ds compati-)-.18 F(bility)
72 518.4 Q 2.901(,b)-1.11 G .401(ut the `)104.901 518.4 R(`$\(...\)')-.37 E
2.901('f)-.37 G .401(orm is pr)169.634 518.4 R(eferr)-.18 E .401
(ed because its quoting r)-.18 F .4(ules ar)-.08 F 2.9(em)-.18 G .4
(uch simpler and it is easier)383.64 518.4 R(to nest.)72 530.4 Q .697
(The Bourne shell does not pr)97 546 R .697(ovide such featur)-.18 F .698
(es as brace expansion, the ability to de\214ne a)-.18 F 2.079(variable and a \
function with the same name, local variables in shell functions, the ability t\
o)72 558 R 1.933
(enable and disable individual builtins or write a function to r)72 570 R 1.933
(eplace a builtin, or a means to)-.18 F(export a shell function to a child pr)
72 582 Q(ocess.)-.18 E 1.019
(Bash has closed a long-standing shell security hole by not using the)97 597.6
R F1($IFS)3.518 E F0 1.018(variable to split)3.518 F .861(each wor)72 609.6 R
3.361(dr)-.18 G .861(ead by the shell, but splitting only the r)126.222 609.6 R
.861(esults of expansion \(ksh and the 4.4 BSD sh)-.18 F .337
(have \214xed this as well\).)72 621.6 R .337
(Useful behavior such as a means to abort execution of a script r)5.337 F .336
(ead with)-.18 F .282(the `)72 633.6 R(`.')-.37 E 2.782('c)-.37 G .283
(ommand using the)108.754 633.6 R F1(return)2.783 E F0 .283
(builtin or automatically exporting variables in the shell's envi-)2.783 F -.18
(ro)72 645.6 S .166(nment to childr).18 F .166(en is also not pr)-.18 F .166
(esent in the Bourne shell.)-.18 F .165(Bash pr)5.165 F .165(ovides a much mor)
-.18 F 2.665(ep)-.18 G(owerful)469.19 645.6 Q(envir)72 657.6 Q
(onment for both interactive use and pr)-.18 E(ogramming.)-.18 E .32 LW 76 688
72 688 DL 80 688 76 688 DL 84 688 80 688 DL 88 688 84 688 DL 92 688 88 688 DL
96 688 92 688 DL 100 688 96 688 DL 104 688 100 688 DL 108 688 104 688 DL 112
688 108 688 DL 116 688 112 688 DL 120 688 116 688 DL 124 688 120 688 DL 128 688
124 688 DL 132 688 128 688 DL 136 688 132 688 DL 140 688 136 688 DL 144 688 140
688 DL/F4 8/Palatino-Roman@0 SF 1.489(\207Bill Joy)72 698 R 3.489(,A)-.888 G
3.489(nI)113.666 698 S(ntr)124.507 698 Q 1.489(oduction to the C Shell,)-.144 F
/F5 8/Palatino-Italic@0 SF 1.489(UNIX User)3.489 F 2.369 -.44('s S).296 H 1.489
(upplementary Documents).44 F F4 3.489(,U)C 1.489(niversity of California at)
377.116 698 R(Berkeley)72 708 Q 2(,1)-.888 G(986.)109.88 708 Q EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-4-)279.67 48 S/F1 10/Palatino-Bold@0 SF 2.5
(4. Bash-speci\214c)72 84 R(Features)2.5 E F0 .897
(This section details a few of the featur)97 99.6 R .897
(es which make Bash unique.)-.18 F .898(Most of them pr)5.898 F(ovide)-.18 E
(impr)72 111.6 Q 2.913(oved interactive use, but a few pr)-.18 F 2.912
(ogramming impr)-.18 F 2.912(ovements ar)-.18 F 5.412(ep)-.18 G -.18(re)410.494
111.6 S 2.912(sent as well.).18 F(Full)7.912 E(descriptions of these featur)72
123.6 Q(es can be found in the Bash documentation.)-.18 E F1 2.5(4.1. Startup)
72 147.6 R(Files)2.5 E F0 .207(Bash executes startup \214les dif)97 163.2 R
(fer)-.18 E .207(ently than other shells.)-.18 F .207
(The Bash behavior is a compr)5.207 F(omise)-.18 E 1.451(between the csh princ\
iple of startup \214les with \214xed names executed for each shell and the sh)
72 175.2 R -.37(``)72 187.2 S(minimalist').37 E 2.677('b)-.37 G(ehavior)138.207
187.2 Q 5.177(.A)-.74 G 2.678(ni)186.504 187.2 S .178
(nteractive instance of Bash started as a login shell r)197.912 187.2 R .178
(eads and executes)-.18 F/F2 10/Palatino-Italic@0 SF(~/.bash_pr)72 199.2 Q
(o\214le)-.18 E F0 .521(\(the \214le .bash_pr)4.687 F .52(o\214le in the user)
-.18 F .52('s home dir).74 F .52(ectory\), if it exists.)-.18 F .52
(An interactive non-)5.52 F 1.692(login shell r)72 211.2 R 1.692
(eads and executes)-.18 F F2(~/.bashr)4.192 E(c)-.18 E F0 6.692(.A)1.666 G
1.693(non-interactive shell \(one begun to execute a shell)271.99 211.2 R .56
(script, for example\) r)72 223.2 R .559
(eads no \214xed startup \214le, but uses the value of the variable)-.18 F F1
($ENV)3.059 E F0 3.059(,i)C 3.059(fs)470.522 223.2 S .559(et, as)481.151 223.2
R .06(the name of a startup \214le.)72 235.2 R .061(The ksh practice of r)5.06
F(eading)-.18 E F1($ENV)2.561 E F0 .061(for every shell, with the accompany-)
2.561 F 1.309(ing dif)72 247.2 R 1.309(\214culty of de\214ning the pr)-.18 F
1.308(oper variables and functions for interactive and non-interactive)-.18 F
.385(shells or having the \214le r)72 259.2 R .385
(ead only for interactive shells, was consider)-.18 F .385(ed too complex.)-.18
F .385(Ease of use)5.385 F .252(won out her)72 271.2 R 2.752(e. Inter)-.18 F
(estingly)-.18 E 2.752(,t)-1.11 G .251(he next r)202.258 271.2 R .251
(elease of ksh will change to r)-.18 F(eading)-.18 E F1($ENV)2.751 E F0 .251
(only for interac-)2.751 F(tive shells.)72 283.2 Q F1 2.5(4.2. New)72 307.2 R
(Builtin Commands)2.5 E F0(Ther)97 322.8 Q 3.077(ea)-.18 G .937 -.18(re a f)
130.377 322.8 T .577(ew builtins which ar).18 F 3.077(en)-.18 G .578
(ew or have been extended in Bash.)259.179 322.8 R(The)5.578 E F1(enable)3.078
E F0(builtin)3.078 E .073(allows builtin commands to be turned on and of)72
334.8 R 2.573(fa)-.18 G(rbitrarily)296.267 334.8 Q 5.073(.T)-1.11 G 2.573(ou)
347.87 334.8 S .073(se the version of)361.933 334.8 R F2(echo)2.573 E F0 .073
(found in a)4.239 F -1.76(user 's)72 346.8 R(sear)2.755 E .255
(ch path rather than the Bash builtin,)-.18 F/F3 10/Courier@0 SF .255
(enable -n echo)2.755 F F0(suf)2.756 E 2.756(\214ces. The)-.18 F F1(help)2.756
E F0 .256(builtin pr)2.756 F(o-)-.18 E .618
(vides quick synopses of the shell facilities without r)72 358.8 R .618
(equiring access to a manual page.)-.18 F F1(Builtin)5.618 E F0(is)3.118 E .955
(similar to)72 370.8 R F1(command)3.455 E F0 .955
(in that it bypasses shell functions and dir)3.455 F .956
(ectly executes builtin commands.)-.18 F 2.025
(Access to a csh-style stack of dir)72 382.8 R 2.025(ectories is pr)-.18 F
2.025(ovided via the)-.18 F F1(pushd)4.524 E F0(,)A F1(popd)4.524 E F0 4.524
(,a)C(nd)429.142 382.8 Q F1(dirs)4.524 E F0(builtins.)4.524 E F1(Pushd)72 394.8
Q F0(and)4.255 E F1(popd)4.255 E F0 1.755(insert and r)4.255 F 1.756(emove dir)
-.18 F 1.756(ectories fr)-.18 F 1.756(om the stack, r)-.18 F(espectively)-.18 E
4.256(,a)-1.11 G(nd)430.102 394.8 Q F1(dirs)4.256 E F0 1.756(lists the)4.256 F
.458(stack contents.)72 406.8 R .457
(On systems that allow \214ne-grained contr)5.458 F .457(ol of r)-.18 F(esour)
-.18 E .457(ces, the)-.18 F F1(ulimit)2.957 E F0 .457(builtin can be)2.957 F
1.216(used to tune these settings.)72 418.8 R F1(Ulimit)6.216 E F0 1.216
(allows a user to contr)3.716 F 1.216(ol, among other things, whether cor)-.18
F(e)-.18 E .306(dumps ar)72 430.8 R 2.806(et)-.18 G 2.806(ob)125.652 430.8 S
2.806(eg)139.448 430.8 S .306
(enerated, how much memory the shell or a child pr)152.604 430.8 R .306
(ocess is allowed to allocate,)-.18 F .991(and how lar)72 442.8 R .991
(ge a \214le cr)-.18 F .991(eated by a child pr)-.18 F .991(ocess can gr)-.18 F
(ow)-.18 E 5.991(.T)-.92 G(he)343.212 442.8 Q F1(suspend)3.491 E F0 .992
(command will stop the)3.491 F .532(shell pr)72 454.8 R .532
(ocess when job contr)-.18 F .532
(ol is active; most other shells do not allow themselves to be stopped)-.18 F
.339(like that.)72 466.8 R F1 -.9(Ty)5.339 G(pe,).9 E F0 .339
(the Bash answer to)2.839 F F1(which)2.839 E F0(and)2.839 E F1(whence,)2.839 E
F0 .34(shows what will happen when a wor)2.839 F 2.84(di)-.18 G(s)499.76 466.8
Q(typed as a command:)72 478.8 Q F3 6($t)97 496.8 S(ype export)115 496.8 Q
(export is a shell builtin)97 508.8 Q 6($t)97 520.8 S(ype -t export)115 520.8 Q
(builtin)97 532.8 Q 6($t)97 544.8 S(ype bash)115 544.8 Q(bash is /bin/bash)97
556.8 Q 6($t)97 568.8 S(ype cd)115 568.8 Q(cd is a function)97 580.8 Q(cd \(\))
97 592.8 Q({)97 604.8 Q(builtin cd ${1+"$@"} && xtitle $HOST: $PWD)121 616.8 Q
(})97 628.8 Q F0 -.92(Va)72 650.4 S 1.138(rious modes tell what a command wor)
.92 F 3.638(di)-.18 G 3.638(s\()273.156 650.4 S -.18(re)284.364 650.4 S 1.138
(served wor).18 F 1.138(d, alias, function, builtin, or \214le\) or)-.18 F .596
(which version of a command will be executed based on a user)72 662.4 R .597
('s sear).74 F .597(ch path.)-.18 F .597(Some of this func-)5.597 F
(tionality has been adopted by POSIX.2 and folded into the)72 674.4 Q F1
(command)2.5 E F0(utility)2.5 E(.)-1.11 E EP
%%Page: 5 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-5-)279.67 48 S/F1 10/Palatino-Bold@0 SF 2.5
(4.3. Editing)72 84 R(and Completion)2.5 E F0 1.094(One ar)97 99.6 R 1.094
(ea in which Bash shines is command line editing.)-.18 F 1.093(Bash uses the)
6.093 F/F2 10/Palatino-Italic@0 SF -.18(re)3.593 G(adline).18 E F0 1.093
(library to)5.259 F -.18(re)72 111.6 S .27(ad and edit lines when interactive.)
.18 F .271(Readline is a powerful and \215exible input facility that a user)
5.27 F .013(can con\214gur)72 123.6 R 2.513(et)-.18 G 2.513(oi)137.466 123.6 S
.013(ndividual tastes.)148.349 123.6 R .012
(It allows lines to be edited using either emacs or vi commands,)5.013 F(wher)
72 135.6 Q 3.039(et)-.18 G .539(hose commands ar)105.809 135.6 R 3.039(ea)-.18
G(ppr)202.526 135.6 Q 3.039(opriate. The)-.18 F .539
(full capability of emacs is not pr)3.039 F .54(esent \255 ther)-.18 F 3.04(ei)
-.18 G 3.04(sn)485.44 135.6 S(o)498.54 135.6 Q .421(way to execute a named com\
mand with M-x, for instance \255 but the existing commands ar)72 147.6 R 2.921
(em)-.18 G(or)489.98 147.6 Q(e)-.18 E 2.773(than adequate.)72 159.6 R 2.773
(The vi mode is compliant with the command line editing standar)7.773 F 2.774
(dized by)-.18 F(POSIX.2.)72 171.6 Q 1.222(Readline is fully customizable.)97
187.2 R 1.221(In addition to the basic commands and key bindings, the)6.222 F
.263(library allows users to de\214ne additional key bindings using a startup \
\214le.)72 199.2 R(The)5.263 E F2(inputr)2.763 E(c)-.18 E F0 .263
(\214le, which)4.429 F .519(defaults to the \214le)72 211.2 R F2(~/.inputr)
3.019 E(c)-.18 E F0 3.019(,i)1.666 G 3.019(sr)204.981 211.2 S .519
(ead each time r)216.01 211.2 R .519
(eadline initializes, permitting users to maintain a)-.18 F 1.084
(consistent interface acr)72 223.2 R 1.084(oss a set of pr)-.18 F 3.585
(ograms. Readline)-.18 F 1.085(includes an extensible interface, so each)3.585
F(pr)72 235.2 Q .885
(ogram using the library can add its own bindable commands and pr)-.18 F .885
(ogram-speci\214c key bind-)-.18 F 2.844(ings. Bash)72 247.2 R .345(uses this \
facility to add bindings that perform history expansion or shell wor)2.844 F
2.845(de)-.18 G(xpan-)478.68 247.2 Q(sions on the curr)72 259.2 Q
(ent input line.)-.18 E .164(Readline interpr)97 274.8 R .163
(ets a number of variables which further tune its behavior)-.18 F 5.163(.V)-.74
G .163(ariables exist to)435.264 274.8 R(contr)72 286.8 Q 2.503
(ol whether or not eight-bit characters ar)-.18 F 5.003(ed)-.18 G(ir)300.789
286.8 Q 2.503(ectly r)-.18 F 2.503(ead as input or converted to meta-)-.18 F
(pr)72 298.8 Q .076(e\214xed key sequences \(a meta-pr)-.18 F .076
(e\214xed key sequence consists of the character with the eighth bit)-.18 F
(zer)72 310.8 Q .204(oed, pr)-.18 F .204(eceded by the)-.18 F F2(meta-pr)2.704
E(e\214x)-.18 E F0(character)4.37 E 2.704(,u)-.74 G .205
(sually escape, which selects an alternate keymap\),)282.17 310.8 R .76
(to decide whether to output characters with the eighth bit set dir)72 322.8 R
.759(ectly or as a meta-pr)-.18 F .759(e\214xed key)-.18 F .19
(sequence, whether or not to wrap to a new scr)72 334.8 R .191
(een line when a line being edited is longer than the)-.18 F(scr)72 346.8 Q
.099(een width, the keymap to which subsequent key bindings should apply)-.18 F
2.598(,o)-1.11 G 2.598(re)411.096 346.8 S .098(ven what happens)422.434 346.8 R
1.031(when r)72 358.8 R 1.031(eadline wants to ring the terminal's bell.)-.18 F
1.031(All of these variables can be set in the inputr)6.031 F(c)-.18 E(\214le.)
72 370.8 Q .239(The startup \214le understands a set of C pr)97 386.4 R(epr)
-.18 E(ocessor)-.18 E .238(-like conditional constr)-.18 F .238
(ucts which allow)-.08 F 1.431
(variables or key bindings to be assigned based on the application using r)72
398.4 R 1.432(eadline, the terminal)-.18 F(curr)72 410.4 Q 1.676
(ently being used, or the editing mode.)-.18 F 1.676(Users can add pr)6.676 F
1.676(ogram-speci\214c bindings to make)-.18 F .478(their lives easier:)72
422.4 R 2.978(Ih)5.478 G .478(ave bindings that let me edit the value of)
165.012 422.4 R F1($P)2.978 E -.92(AT)-.74 G(H).92 E F0 .479
(and double-quote the cur)2.979 F(-)-.18 E -.18(re)72 434.4 S(nt or pr).18 E
(evious wor)-.18 E(d:)-.18 E/F3 10/Courier@0 SF 6(#M)97 452.4 S
(acros that are convenient for shell interaction)115 452.4 Q($if Bash)97 464.4
Q 6(#e)97 476.4 S(dit the path)115 476.4 Q
("\\C-xp": "PATH=${PATH}\\e\\C-e\\C-a\\ef\\C-f")97 488.4 Q 6(#p)97 500.4 S
(repare to type a quoted word -- insert open and close double)115 500.4 Q 6(#q)
97 512.4 S(uotes and move to just after the open quote)115 512.4 Q
("\\C-x\\"": "\\"\\"\\C-b")97 524.4 Q 6(#Q)97 536.4 S
(uote the current or previous word)115 536.4 Q("\\C-xq": "\\eb\\"\\ef\\"")97
548.4 Q($endif)97 560.4 Q F0(Ther)72 582 Q 3.06(ei)-.18 G 3.06(sar)103.27 582 S
.56(eadline command to r)122.4 582 R(e-r)-.18 E .559
(ead the \214le, so users can edit the \214le, change some bindings,)-.18 F
(and begin to use them almost immediately)72 594 Q(.)-1.11 E .701
(Bash implements the)97 609.6 R F1(bind)3.201 E F0 .701(builtin for mor)3.201 F
3.201(ed)-.18 G .701(yamic contr)299.567 609.6 R .702(ol of r)-.18 F .702
(eadline than the startup \214le)-.18 F(permits.)72 621.6 Q F1(Bind)5.572 E F0
.572(is used in several ways.)3.072 F(In)5.572 E F2(list)3.071 E F0 .571
(mode, it can display the curr)4.737 F .571(ent key bindings, list)-.18 F .752
(all the r)72 633.6 R .752(eadline editing dir)-.18 F .752
(ectives available for binding, list which keys invoke a given dir)-.18 F
(ective,)-.18 E 1.327(or output the curr)72 645.6 R 1.327
(ent set of key bindings in a format that can be incorporated dir)-.18 F 1.327
(ectly into an)-.18 F(inputr)72 657.6 Q 3.075<638c>-.18 G 3.075(le. In)113.365
657.6 R F2(batch)3.075 E F0 .575(mode, it r)4.741 F .575
(eads a series of key bindings dir)-.18 F .575(ectly fr)-.18 F .576
(om a \214le and passes them)-.18 F .751(to r)72 669.6 R 3.251(eadline. In)-.18
F .751(its most common usage,)3.251 F F1(bind)3.251 E F0 .75
(takes a single string and passes it dir)3.251 F .75(ectly to r)-.18 F(ead-)
-.18 E .604(line, which interpr)72 681.6 R .604
(ets the line as if it had just been r)-.18 F .605(ead fr)-.18 F .605
(om the inputr)-.18 F 3.105<638c>-.18 G 3.105(le. Both)406.525 681.6 R .605
(key bindings)3.105 F
(and variable assignments may appear in the string given to)72 693.6 Q F1(bind)
2.5 E F0(.)A 1.692(The r)97 709.2 R 1.691(eadline library also pr)-.18 F 1.691
(ovides an interface for)-.18 F F2 1.691(word completion)4.191 F F0 6.691(.W)C
1.691(hen the)419.582 709.2 R F2(completion)4.191 E F0 3.377
(character \(usually T)72 721.2 R 3.377(AB\) is typed, r)-.74 F 3.378
(eadline looks at the wor)-.18 F 5.878(dc)-.18 G(urr)375.406 721.2 Q 3.378
(ently being enter)-.18 F 3.378(ed and)-.18 F EP
%%Page: 6 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-6-)279.67 48 S .089
(computes the set of \214lenames of which the curr)72 84 R .088(ent wor)-.18 F
2.588(di)-.18 G 2.588(sav)326.968 84 S .088(alid pr)347.034 84 R 2.588
(e\214x. If)-.18 F(ther)2.588 E 2.588(ei)-.18 G 2.588(so)437.136 84 S .088
(nly one pos-)449.424 84 R .81(sible completion, the r)72 96 R .81
(est of the characters ar)-.18 F 3.31(ei)-.18 G .81(nserted dir)285.2 96 R
(ectly)-.18 E 3.31(,o)-1.11 G .81(therwise the common pr)365.38 96 R .81
(e\214x of)-.18 F .715(the set of \214lenames is added to the curr)72 108 R
.715(ent wor)-.18 F 3.215(d. A)-.18 F .714(second T)3.214 F .714
(AB character enter)-.74 F .714(ed immediately)-.18 F .527
(after a non-unique completion causes r)72 120 R .527
(eadline to list the possible completions; ther)-.18 F 3.027(ei)-.18 G 3.028
(sa)453.964 120 S 3.028(no)466.232 120 S(ption)480.54 120 Q .265
(to have the list displayed immediately)72 132 R 5.265(.R)-1.11 G .265
(eadline pr)255.87 132 R .264(ovides hooks so that applications can pr)-.18 F
(ovide)-.18 E 1.287(speci\214c types of completion befor)72 144 R 3.787(et)-.18
G 1.287(he default \214lename completion is attempted.)237.284 144 R 1.287
(This is quite)6.287 F 1.378(\215exible, though it is not completely user)72
156 R(-pr)-.18 E 3.877(ogrammable. Bash,)-.18 F 1.377
(for example, can complete \214le-)3.877 F 1.456
(names, command names \(including aliases, builtins, shell r)72 168 R 1.457
(eserved wor)-.18 F 1.457(ds, shell functions, and)-.18 F .598(executables fou\
nd in the \214le system\), shell variables, usernames, and hostnames.)72 180 R
.598(It uses a set of)5.598 F .346(heuristics that, while not perfect, is gene\
rally quite good at determining what type of completion)72 192 R(to attempt.)72
204 Q/F1 10/Palatino-Bold@0 SF 2.5(4.4. History)72 228 R F0 .487
(Access to the list of commands pr)97 243.6 R .487(eviously enter)-.18 F .487
(ed \(the)-.18 F/F2 10/Palatino-Italic@0 SF .487(command history)2.987 F F0
2.987(\)i)C 2.987(sp)424.717 243.6 S -.18(ro)437.954 243.6 S .486
(vided jointly).18 F .577(by Bash and the r)72 255.6 R .577(eadline library)
-.18 F 5.577(.B)-1.11 G .578(ash pr)229.432 255.6 R .578(ovides variables \()
-.18 F F1($HISTFILE)A F0(,)A F1($HISTSIZE)3.078 E F0 3.078(,a)C(nd)456.582
255.6 Q F1($HIST)3.078 E(-)-.92 E(CONTROL)72 267.6 Q F0 3.306(\)a)C .806
(nd the)135.846 267.6 R F1(history)3.306 E F0(and)3.306 E F1(fc)3.306 E F0 .805
(builtins to manipulate the history list.)3.305 F .805(The value of)5.805 F F1
($HIST)3.305 E(-)-.92 E(FILE)72 279.6 Q F0 1.393(specifes the \214le wher)3.893
F 3.893(eB)-.18 G 1.393(ash writes the command history on exit and r)209.125
279.6 R 1.394(eads it on startup.)-.18 F F1($HISTSIZE)72 291.6 Q F0 1.295
(is used to limit the number of commands saved in the history)3.795 F(.)-1.11 E
F1($HISTCONTROL)6.294 E F0(pr)72 303.6 Q .778(ovides a cr)-.18 F .779
(ude form of contr)-.08 F .779(ol over which commands ar)-.18 F 3.279(es)-.18 G
.779(aved on the history list: a value of)349.157 303.6 R F2(ignor)72 315.6 Q
(espace)-.18 E F0 .548
(means to not save commands which begin with a space; a value of)4.714 F F2
(ignor)3.047 E(edups)-.18 E F0(means)4.713 E .296
(to not save commands identical to the last command saved.)72 327.6 R F1
($HISTCONTROL)5.296 E F0 .297(was named)2.796 F F1($his-)2.797 E(tory_control)
72 339.6 Q F0 .611
(in earlier versions of Bash; the old name is still accepted for backwar)3.112
F .611(ds compatibil-)-.18 F(ity)72 351.6 Q 5.678(.T)-1.11 G(he)96.928 351.6 Q
F1(history)3.178 E F0 .678(command can r)3.178 F .678
(ead or write \214les containing the history list and display the cur)-.18 F(-)
-.18 E -.18(re)72 363.6 S .913(nt list contents.).18 F(The)5.913 E F1(fc)3.413
E F0 .913(builtin, adopted fr)3.413 F .912
(om POSIX.2 and the Korn Shell, allows display and)-.18 F -.18(re)72 375.6 S
.12(-execution, with optional editing, of commands fr).18 F .12
(om the history list.)-.18 F .12(The r)5.12 F .12(eadline library of)-.18 F
(fers)-.18 E 2.518(as)72 387.6 S .018(et of commands to sear)83.758 387.6 R
.018(ch the history list for a portion of the curr)-.18 F .017
(ent input line or a string typed)-.18 F 1.024(by the user)72 399.6 R 6.025(.F)
-.74 G(inally)136.364 399.6 Q 3.525(,t)-1.11 G(he)169.649 399.6 Q F2(history)
3.525 E F0(library)5.191 E 3.525(,g)-1.11 G 1.025(enerally incorporated dir)
257.59 399.6 R 1.025(ectly into the r)-.18 F 1.025(eadline library)-.18 F(,)
-1.11 E .709(implements a facility for history r)72 411.6 R .709
(ecall, expansion, and r)-.18 F .709(e-execution of pr)-.18 F .709
(evious commands very)-.18 F .711(similar to csh \(`)72 423.6 R .711
(`bang history')-.37 F .711(', so called because the exclamation point intr)
-.37 F .712(oduces a history sub-)-.18 F(stitution\):)72 435.6 Q/F3 10
/Courier@0 SF 6($e)97 453.6 S(cho a b c d e)115 453.6 Q 6(abcde)97 465.6 S 6
($!)97 477.6 S 6(!fghi)115 477.6 S(echo a b c d e f g h i)97 489.6 Q 6
(abcdefghi)97 501.6 S 6($!)97 513.6 S(-2)115 513.6 Q(echo a b c d e)97 525.6 Q
6(abcde)97 537.6 S 6($e)97 549.6 S(cho !-2:1-4)115 549.6 Q(echo a b c d)97
561.6 Q 6(abcd)97 573.6 S F0 .555(The command history is only saved when the s\
hell is interactive, so it is not available for use by)72 595.2 R
(shell scripts.)72 607.2 Q F1 2.5(4.5. New)72 631.2 R(Shell V)2.5 E(ariables)
-1.11 E F0(Ther)97 646.8 Q 2.916(ea)-.18 G .776 -.18(re a n)130.216 646.8 T
.416(umber of convenience variables that Bash interpr).18 F .417
(ets to make life easier)-.18 F 5.417(.T)-.74 G(hese)484.36 646.8 Q(include)72
658.8 Q F1(FIGNORE)3.043 E F0 3.043(,w)C .542(hich is a set of \214lename suf)
169.706 658.8 R .542(\214xes identifying \214les to exclude when complet-)-.18
F .167(ing \214lenames;)72 670.8 R F1(HOSTTYPE)2.667 E F0 2.667(,w)C .167
(hich is automatically set to a string describing the type of har)205.061 670.8
R(dwar)-.18 E(e)-.18 E .333(on which Bash is curr)72 682.8 R .333
(ently executing;)-.18 F F1(command_oriented_history)2.833 E F0 2.832(,w)C .332
(hich dir)380.94 682.8 R .332(ects Bash to save all)-.18 F 1.264
(lines of a multiple-line command such as a)72 694.8 R F2(while)3.765 E F0(or)
3.765 E F2(for)3.765 E F0 1.265(loop in a single history entry)3.765 F 3.765
(,a)-1.11 G(llowing)470.09 694.8 Q .13(easy r)72 706.8 R .13(e-editing; and)
-.18 F F1(IGNOREEOF)2.63 E F0 2.63(,w)C .13
(hose value indicates the number of consecutive EOF charac-)237.84 706.8 R .901
(ters that an interactive shell will r)72 718.8 R .901(ead befor)-.18 F 3.401
(ee)-.18 G .901(xiting \255 an easy way to keep yourself fr)280.258 718.8 R
.902(om being)-.18 F 3.629(logged out accidentally)72 730.8 R 8.629(.T)-1.11 G
(he)198.697 730.8 Q F1(auto_resume)6.129 E F0 3.628
(variable alters the way the shell tr)6.128 F 3.628(eats simple)-.18 F EP
%%Page: 7 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-7-)279.67 48 S .888
(command names: if job contr)72 84 R .889
(ol is active, and this variable is set, single-wor)-.18 F 3.389(ds)-.18 G .889
(imple commands)426.431 84 R .843(without r)72 96 R(edir)-.18 E .843
(ections cause the shell to \214rst look for and r)-.18 F .842
(estart a suspended job with that name)-.18 F(befor)72 108 Q 2.5(es)-.18 G
(tarting a new pr)106.41 108 Q(ocess.)-.18 E/F1 10/Palatino-Bold@0 SF 2.5
(4.6. Brace)72 132 R(Expansion)2.5 E F0 .608(Since sh of)97 147.6 R .609
(fers no convenient way to generate arbitrary strings that shar)-.18 F 3.109
(eac)-.18 G .609(ommon pr)440.711 147.6 R(e\214x)-.18 E .036(or suf)72 159.6 R
.036(\214x \(\214lename expansion r)-.18 F(equir)-.18 E .035
(es that the \214lenames exist\), Bash implements)-.18 F/F2 10
/Palatino-Italic@0 SF .035(brace expansion)2.535 F F0 2.535(,a)C .716
(capability picked up fr)72 171.6 R .716(om csh.)-.18 F .717
(Brace expansion is similar to \214lename expansion, but the strings)5.716 F
2.557(generated need not corr)72 183.6 R 2.557(espond to existing \214les.)-.18
F 5.057(Ab)7.557 G 2.557(race expr)322.296 183.6 R 2.557
(ession consists of an optional)-.18 F F2(pr)72 195.6 Q(eamble)-.18 E F0 4.412
(,f)1.666 G 1.912(ollowed by a pair of braces enclosing a series of comma-sepa\
rated strings, and an)120.028 195.6 R(optional)72 207.6 Q F2(postamble)2.842 E
F0 5.342(.T)1.666 G .342(he pr)167.49 207.6 R .342(eamble is pr)-.18 F .342
(epended to each string within the braces, and the postam-)-.18 F
(ble is then appended to each r)72 219.6 Q(esulting string:)-.18 E/F3 10
/Courier@0 SF 6($e)97 237.6 S(cho a{d,c,b}e)115 237.6 Q(ade ace abe)97 249.6 Q
F0 .898(As this example demonstrates, the r)72 271.2 R .899
(esults of brace expansion ar)-.18 F 3.399(en)-.18 G .899
(ot sorted, as they ar)374.176 271.2 R 3.399(eb)-.18 G 3.399<798c>477.961 271.2
S(le-)492.97 271.2 Q(name expansion.)72 283.2 Q F1 2.5(4.7. Process)72 307.2 R
(Substitution)2.5 E F0 .692(On systems that can support it, Bash pr)97 322.8 R
.692(ovides a facility known as)-.18 F F2(pr)3.192 E .692(ocess substitution)
-.18 F F0 5.692(.P)C -.18(ro)491.44 322.8 S(-).18 E .479(cess substitution is \
similar to command substitution in that its speci\214cation includes a command)
72 334.8 R .969(to execute, but the shell does not collect the command's outpu\
t and insert it into the command)72 346.8 R 2.925(line. Rather)72 358.8 R 2.925
(,B)-.74 G .425(ash opens a pipe to the command, which is r)136.65 358.8 R .426
(un in the backgr)-.08 F 2.926(ound. The)-.18 F .426(shell uses)2.926 F .659
(named pipes \(FIFOs\) or the)72 370.8 R F2(/dev/fd)3.158 E F0 .658
(method of naming open \214les to expand the pr)4.824 F .658(ocess substitu-)
-.18 F .559(tion to a \214lename which connects to the pipe when opened.)72
382.8 R .56(This \214lename becomes the r)5.56 F .56(esult of)-.18 F .302
(the expansion.)72 394.8 R(Pr)5.302 E .302
(ocess substitution can be used to compar)-.18 F 2.801(et)-.18 G .301
(he outputs of two dif)344.255 394.8 R(fer)-.18 E .301(ent versions)-.18 F
(of an application as part of a r)72 406.8 Q(egr)-.18 E(ession test:)-.18 E F3
6($c)97 424.8 S(mp <\(old_prog\) <\(new_prog\))115 424.8 Q F1 2.5(4.8. Prompt)
72 454.8 R(Customization)2.5 E F0 .745(One of the mor)97 470.4 R 3.245(ep)-.18
G .745(opular interactive featur)179.97 470.4 R .745(es that Bash pr)-.18 F
.745(ovides is the ability to customize)-.18 F 1.946(the pr)72 482.4 R 4.446
(ompt. Both)-.18 F F1($PS1)4.446 E F0(and)4.446 E F1($PS2,)4.446 E F0 1.945
(the primary and secondary pr)4.445 F 1.945(ompts, ar)-.18 F 4.445(ee)-.18 G
1.945(xpanded befor)432.885 482.4 R(e)-.18 E 2.168(being displayed.)72 494.4 R
2.168(Parameter and variable expansion is performed when the pr)7.168 F 2.169
(ompt string is)-.18 F .77
(expanded, so any shell variable can be put into the pr)72 506.4 R .77
(ompt \(e.g.,)-.18 F F1($SHL)3.27 E(VL)-.92 E F0 3.27(,w)C .77
(hich indicates how)419.37 506.4 R .609(deeply the curr)72 518.4 R .609
(ent shell is nested\).)-.18 F .609(Bash specially interpr)5.609 F .609
(ets characters in the pr)-.18 F .61(ompt string pr)-.18 F(e-)-.18 E 1.224
(ceded by a backslash.)72 530.4 R 1.224(Some of these backslash escapes ar)
6.224 F 3.724(er)-.18 G 1.224(eplaced with the curr)348.91 530.4 R 1.224
(ent time, the)-.18 F .542(date, the curr)72 542.4 R .542(ent working dir)-.18
F(ectory)-.18 E 3.042(,t)-1.11 G .542
(he username, and the command number or history number)237.3 542.4 R .623
(of the command being enter)72 554.4 R 3.123(ed. Ther)-.18 F 3.123(ei)-.18 G
3.122(se)249.038 554.4 S .622
(ven a backslash escape to cause the shell to change its)261.19 554.4 R(pr)72
566.4 Q 1.098(ompt when r)-.18 F 1.098(unning as r)-.08 F 1.098(oot after an)
-.18 F F2(su)3.599 E F0 6.099(.B)C(efor)273.626 566.4 Q 3.599(ep)-.18 G 1.099
(rinting each primary pr)305.375 566.4 R 1.099(ompt, Bash expands)-.18 F 1.458
(the variable)72 578.4 R F1($PROMPT_COMMAND)3.958 E F0 1.457
(and, if it has a value, executes the expanded value as a)3.957 F 1.038
(command, allowing additional pr)72 590.4 R 1.038(ompt customization.)-.18 F
1.038(For example, this assignment causes the)6.038 F(curr)72 602.4 Q .754
(ent user)-.18 F 3.254(,t)-.74 G .754(he curr)134.598 602.4 R .753
(ent host, the time, the last component of the curr)-.18 F .753
(ent working dir)-.18 F(ectory)-.18 E 3.253(,t)-1.11 G(he)493.39 602.4 Q .813
(level of shell nesting, and the history number of the curr)72 614.4 R .813
(ent command to be embedded into the)-.18 F(primary pr)72 626.4 Q(ompt:)-.18 E
F3 6($P)97 644.4 S(S1='\\u@\\h [\\t] \\W\($SHLVL:\\!\)\\$ ')115 644.4 Q
(chet@odin [21:03:44] documentation\(2:636\)$ cd ..)97 656.4 Q
(chet@odin [21:03:54] src\(2:637\)$)97 668.4 Q F0 1.289
(The string being assigned is surr)72 690 R 1.289
(ounded by single quotes so that if it is exported, the value of)-.18 F F1
($SHL)72 702 Q(VL)-.92 E F0(will be updated by a child shell:)2.5 E F3
(chet@odin [21:17:35] src\(2:638\)$ export PS1)97 720 Q EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-8-)279.67 48 S/F1 10/Courier@0 SF
(chet@odin [21:17:40] src\(2:639\)$ bash)97 84 Q
(chet@odin [21:17:46] src\(3:696\)$)97 96 Q F0 .981
(The \\$ escape is displayed as `)72 117.6 R(`)-.37 E/F2 10/Palatino-Bold@0 SF
($)A F0 1.721 -.37('' w)D .981(hen r).37 F .981(unning as a normal user)-.08 F
3.481(,b)-.74 G .981(ut as `)382.843 117.6 R(`)-.37 E F2(#)A F0 1.721 -.37
('' w)D .982(hen r).37 F .982(unning as)-.08 F -.18(ro)72 129.6 S(ot.).18 E F2
2.5(4.9. File)72 153.6 R(System V)2.5 E(iews)-.55 E F0 .42(Since Berkeley intr)
97 169.2 R .42(oduced symbolic links in 4.2 BSD, one of their most annoying pr)
-.18 F(operties)-.18 E .705(has been the `)72 181.2 R(`warping')-.37 E 3.205
('t)-.37 G 3.205(oac)185.91 181.2 S .705(ompletely dif)207.22 181.2 R(fer)-.18
E .705(ent ar)-.18 F .705(ea of the \214le system when using)-.18 F F2(cd)3.206
E F0 3.206(,a)C .706(nd the)474.994 181.2 R -.18(re)72 193.2 S 2.292
(sultant non-intuitive behavior of `).18 F(`)-.37 E F2 2.292(cd ..)B F0 -.37
('')C 7.291(.T).37 G(he)282.761 193.2 Q/F3 9/Palatino-Roman@0 SF(UNIX)4.791 E
F0 2.291(kernel tr)4.791 F 2.291(eats symbolic links)-.18 F/F4 10
/Palatino-Italic@0 SF(physically)4.791 E F0(.)1.666 E .225(When the kernel is \
translating a pathname in which one component is a symbolic link, it r)72 205.2
R(eplaces)-.18 E .81(all or part of the pathname while pr)72 217.2 R .81
(ocessing the link.)-.18 F .81(If the contents of the symbolic link begin)5.81
F .033(with a slash, the kernel r)72 229.2 R .033(eplaces the pathname entir)
-.18 F .033(ely; if not, the link contents r)-.18 F .034(eplace the curr)-.18 F
(ent)-.18 E 2.814(component. In)72 241.2 R .314
(either case, the symbolic link is visible.)2.814 F .313
(If the link value is an absolute pathname,)5.314 F
(the user \214nds himself in a completely dif)72 253.2 Q(fer)-.18 E
(ent part of the \214le system.)-.18 E 1.291(Bash pr)97 268.8 R 1.291(ovides a)
-.18 F F4(logical)3.791 E F0 1.291(view of the \214le system.)5.457 F 1.292
(In this default mode, command and \214le-)6.292 F .727
(name completion and builtin commands such as)72 280.8 R F2(cd)3.227 E F0(and)
3.227 E F2(pushd)3.227 E F0 .727(which change the curr)3.227 F .727(ent work-)
-.18 F .245(ing dir)72 292.8 R .245(ectory transpar)-.18 F .245
(ently follow symbolic links as if they wer)-.18 F 2.746(ed)-.18 G(ir)365.822
292.8 Q 2.746(ectories. The)-.18 F F2($PWD)2.746 E F0(variable,)2.746 E .562
(which holds the shell's idea of the curr)72 304.8 R .561(ent working dir)-.18
F(ectory)-.18 E 3.061(,d)-1.11 G .561(epends on the path used to r)354.924
304.8 R(each)-.18 E(the dir)72 316.8 Q
(ectory rather than its physical location in the local \214le system hierar)
-.18 E(chy)-.18 E 5(.F)-1.11 G(or example:)427.35 316.8 Q F1 6($c)97 334.8 S 6
(d/)115 334.8 S(usr/local/bin)133 334.8 Q 6($e)97 346.8 S(cho $PWD)115 346.8 Q
(/usr/local/bin)97 358.8 Q 6($p)97 370.8 S(wd)115 370.8 Q(/usr/local/bin)97
382.8 Q 6($/)97 394.8 S(bin/pwd)115 394.8 Q(/net/share/sun4/local/bin)97 406.8
Q 6($c)97 418.8 S 6(d.)115 418.8 S(.)133 418.8 Q 6($p)97 430.8 S(wd)115 430.8 Q
(/usr/local)97 442.8 Q 6($/)97 454.8 S(bin/pwd)115 454.8 Q
(/net/share/sun4/local)97 466.8 Q 6($c)97 478.8 S 6(d.)115 478.8 S(.)133 478.8
Q 6($p)97 490.8 S(wd)115 490.8 Q(/usr)97 502.8 Q 6($/)97 514.8 S(bin/pwd)115
514.8 Q(/usr)97 526.8 Q F0 .094(One pr)72 548.4 R .094
(oblem with this, of course, arises when pr)-.18 F .095
(ograms that do not understand the shell's logical)-.18 F .805
(notion of the \214le system interpr)72 560.4 R .805(et `)-.18 F(`..')-.37 E
3.305('d)-.37 G(if)251.245 560.4 Q(fer)-.18 E(ently)-.18 E 5.805(.T)-1.11 G
.804(his generally happens when Bash completes)304.86 560.4 R 1.864
(\214lenames containing `)72 572.4 R(`..')-.37 E 4.364('a)-.37 G(ccor)194.902
572.4 Q 1.864(ding to a logical hierar)-.18 F 1.865(chy which does not corr)
-.18 F 1.865(espond to their)-.18 F .584(physical location.)72 584.4 R .583
(For users who \214nd this tr)5.584 F .583(oublesome, a corr)-.18 F(esponding)
-.18 E F4(physical)3.083 E F0 .583(view of the \214le)4.749 F
(system is available:)72 596.4 Q F1 6($c)97 614.4 S 6(d/)115 614.4 S
(usr/local/bin)133 614.4 Q 6($p)97 626.4 S(wd)115 626.4 Q(/usr/local/bin)97
638.4 Q 6($s)97 650.4 S(et -o physical)115 650.4 Q 6($p)97 662.4 S(wd)115 662.4
Q(/net/share/sun4/local/bin)97 674.4 Q EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-9-)279.67 48 S/F1 10/Palatino-Bold@0 SF 2.5
(4.10. Internationalization)72 84 R F0 .316(One of the most signi\214cant impr)
97 99.6 R .316(ovements in version 1.13 of Bash was the change to `)-.18 F
(`eight-)-.37 E .534(bit cleanliness')72 111.6 R 3.034('. Pr)-.37 F .533
(evious versions used the eighth bit of characters to mark whether or not they)
-.18 F(wer)72 123.6 Q 3.109(eq)-.18 G .609(uoted when performing wor)102.399
123.6 R 3.109(de)-.18 G 3.109(xpansions. While)244.335 123.6 R .609
(this did not af)3.109 F .61(fect the majority of users,)-.18 F 1.249
(most of whom used only seven-bit ASCII characters, some found it con\214ning.)
72 135.6 R 1.248(Beginning with)6.248 F .251
(version 1.13, Bash implemented a dif)72 147.6 R(fer)-.18 E .251
(ent quoting mechanism that did not alter the eighth bit of)-.18 F 3.228
(characters. This)72 159.6 R .727(allowed Bash to manipulate \214les with `)
3.228 F(`odd')-.37 E 3.227('c)-.37 G .727(haracters in their names, but did)
356.825 159.6 R 1.924
(nothing to help users enter those names, so version 1.13 intr)72 171.6 R 1.925
(oduced changes to r)-.18 F 1.925(eadline that)-.18 F .658
(made it eight-bit clean as well.)72 183.6 R .658(Options exist that for)5.658
F .658(ce r)-.18 F .658(eadline to attach no special signi\214cance)-.18 F .834
(to characters with the eighth bit set \(the default behavior is to convert th\
ese characters to meta-)72 195.6 R(pr)72 207.6 Q 2.375(e\214xed key sequences\
\) and to output these characters without conversion to meta-pr)-.18 F
(e\214xed)-.18 E 2.924(sequences. These)72 219.6 R .424
(changes, along with the expansion of keymaps to a full eight bits, enable r)
2.924 F(ead-)-.18 E 1.025(line to work with most of the ISO-8859 family of cha\
racter sets, used by many Eur)72 231.6 R 1.025(opean coun-)-.18 F(tries.)72
243.6 Q F1(4.1)72 267.6 Q 2.5(1. POSIX)-.37 F(Mode)2.5 E F0 .834
(Although Bash is intended to be POSIX.2 conformant, ther)97 283.2 R 3.334(ea)
-.18 G 1.194 -.18(re a)374.606 283.2 T -.18(re).18 G .835
(as in which the default).18 F .622
(behavior is not compatible with the standar)72 295.2 R 3.121(d. For)-.18 F
.621(users who wish to operate in a strict POSIX.2)3.121 F(envir)72 307.2 Q
2.453(onment, Bash implements a)-.18 F/F2 10/Palatino-Italic@0 SF 2.453
(POSIX mode)4.953 F F0 7.453(.W)C 2.453
(hen this mode is active, Bash modi\214es its)305.808 307.2 R .969
(default operation wher)72 319.2 R 3.469(ei)-.18 G 3.469(td)186.917 319.2 S(if)
199.756 319.2 Q .969(fers fr)-.18 F .969(om POSIX.2 to match the standar)-.18 F
3.468(d. POSIX)-.18 F .968(mode is enter)3.468 F(ed)-.18 E .474
(when Bash is started with the)72 331.2 R F1(-posix)2.974 E F0 2.974
(option. This)2.974 F(featur)2.974 E 2.974(ei)-.18 G 2.975(sa)334.31 331.2 S
.475(lso available as an option to the)346.525 331.2 R F1(set)2.975 E F0
(builtin,)72 343.2 Q F1 1.631(set -o posix)4.131 F F0 6.631(.F)C 1.631
(or compatibility with other GNU softwar)177.054 343.2 R 4.131(et)-.18 G 1.63
(hat attempts to be POSIX.2)379.02 343.2 R .627
(compliant, Bash also enters POSIX mode if the variable)72 355.2 R F1($POSIXL)
3.128 E(Y_CORRECT)-.92 E F0 .628(is set when Bash)3.128 F .891
(is started or assigned a value during execution.)72 367.2 R F1
($POSIX_PEDANTIC)5.891 E F0 .89(is accepted as well, to be)3.391 F .445
(compatible with some older GNU utilities.)72 379.2 R .446
(When Bash is started in POSIX mode, for example, it)5.445 F(sour)72 391.2 Q
.342(ces the \214le named by the value of)-.18 F F1($ENV)2.842 E F0 .342
(rather than the `)2.842 F(`normal')-.37 E 2.842('s)-.37 G .341
(tartup \214les, and does not)392.566 391.2 R(allow r)72 403.2 Q(eserved wor)
-.18 E(ds to be aliased.)-.18 E F1 2.5(5. New)72 427.2 R
(Features and Future Plans)2.5 E F0(Ther)97 442.8 Q 4.157(ea)-.18 G 2.017 -.18
(re s)131.457 442.8 T 1.658(everal featur).18 F 1.658(es intr)-.18 F 1.658
(oduced in the curr)-.18 F 1.658(ent version of Bash, version 1.14, and a)-.18
F .714(number under consideration for futur)72 454.8 R 3.214(er)-.18 G 3.214
(eleases. This)253.61 454.8 R .714
(section will brie\215y detail the new featur)3.214 F(es)-.18 E
(in version 1.14 and describe several featur)72 466.8 Q
(es that may appear in later versions.)-.18 E F1 2.5(5.1. New)72 490.8 R
(Features in Bash-1.14)2.5 E F0 1.303(The new featur)97 506.4 R 1.304
(es available in Bash-1.14 answer several of the most common r)-.18 F 1.304
(equests for)-.18 F 2.815(enhancements. Most)72 518.4 R(notably)2.815 E 2.815
(,t)-1.11 G(her)209.475 518.4 Q 2.815(ei)-.18 G 2.815(sam)234.37 518.4 S .314
(echanism for including non-visible character sequences)258.07 518.4 R 1.795
(in pr)72 530.4 R 1.796
(ompts, such as those which cause a terminal to print characters in dif)-.18 F
(fer)-.18 E 1.796(ent colors or in)-.18 F .354(standout mode.)72 542.4 R(Ther)
5.354 E 2.854(ew)-.18 G .354(as nothing pr)183.572 542.4 R .353
(eventing the use of these sequences in earlier versions, but)-.18 F 2.113
(the r)72 554.4 R 2.113(eadline r)-.18 F 2.114
(edisplay algorithm assumed each character occupied physical scr)-.18 F 2.114
(een space and)-.18 F(would wrap lines pr)72 566.4 Q(ematur)-.18 E(ely)-.18 E
(.)-1.11 E 1.183(Readline has a few new variables, several new bindable comman\
ds, and some additional)97 582 R 1.399(emacs mode default key bindings.)72 594
R 3.899(An)6.399 G 1.399(ew history sear)252.724 594 R 1.4
(ch mode has been implemented: in this)-.18 F .033(mode, r)72 606 R .033
(eadline sear)-.18 F .032(ches the history for lines beginning with the charac\
ters between the beginning)-.18 F .452(of the curr)72 618 R .452
(ent line and the cursor)-.18 F 5.452(.T)-.74 G .452(he existing r)233.074 618
R .452(eadline incr)-.18 F .452(emental sear)-.18 F .453(ch commands no longer)
-.18 F .947(match identical lines mor)72 630 R 3.447(et)-.18 G .947(han once.)
198.068 630 R .946(Filename completion now expands variables in dir)5.947 F
(ectory)-.18 E 2.516(names. The)72 642 R .016(history expansion facilities ar)
2.516 F 2.516(en)-.18 G .017
(ow nearly completely csh-compatible: missing modi-)270.006 642 R
(\214ers have been added and history substitution has been extended.)72 654 Q
.535(Several of the featur)97 669.6 R .535(es described earlier)-.18 F 3.035
(,s)-.74 G .535(uch as)282.59 669.6 R F1 .534(set -o posix)3.035 F F0(and)3.034
E F1($POSIX_PEDANTIC)3.034 E F0 3.034(,a)C -.18(re)495.44 669.6 S .749
(new in version 1.14.)72 681.6 R(Ther)5.749 E 3.249(ei)-.18 G 3.249(san)199.455
681.6 S .749(ew shell variable,)221.013 681.6 R F1(OSTYPE)3.249 E F0 3.25(,t)C
3.25(ow)351.81 681.6 S .75(hich Bash assigns a value that)368.86 681.6 R .417
(identi\214es the version of)72 693.6 R/F3 9/Palatino-Roman@0 SF(UNIX)2.917 E
F0 .416(it's r)2.917 F .416(unning on \(gr)-.08 F .416(eat for putting ar)-.18
F(chitectur)-.18 E .416(e-speci\214c binary dir)-.18 F(ec-)-.18 E 2.257
(tories into the)72 705.6 R F1($P)4.757 E -.92(AT)-.74 G(H).92 E F0 4.757
(\). T)B 2.257(wo variables have been r)-.9 F(enamed:)-.18 E F1($HISTCONTROL)
4.758 E F0 -.18(re)4.758 G(places).18 E F1($his-)4.758 E(tory_control)72 717.6
Q F0 5.733(,a)C(nd)140.793 717.6 Q F1($HOSTFILE)5.733 E F0 -.18(re)5.732 G
(places).18 E F1($hostname_completion_\214le)5.732 E F0 8.232(.I)C 5.732(nb)
401.622 717.6 S 3.232(oth cases, the old)418.704 717.6 R 2.337(names ar)72
729.6 R 4.837(ea)-.18 G 2.338(ccepted for backwar)128.914 729.6 R 2.338
(ds compatibility)-.18 F 7.338(.T)-1.11 G 2.338(he ksh)311.846 729.6 R F2
(select)4.838 E F0(constr)6.504 E 2.338(uct, which allows the)-.08 F EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-1)277.17 48 S 2.5(0-)288 48 S .565
(generation of simple menus, has been implemented.)72 84 R .564
(New capabilities have been added to exist-)5.565 F 1.446(ing variables:)72 96
R/F1 10/Palatino-Bold@0 SF($auto_resume)3.946 E F0 1.446
(can now take values of)3.946 F/F2 10/Palatino-Italic@0 SF(exact)3.947 E F0(or)
5.613 E F2(substring)3.947 E F0 3.947(,a)1.666 G(nd)405.913 96 Q F1
($HISTCONTROL)3.947 E F0 1.8(understands the value)72 108 R F2(ignor)4.3 E
(eboth)-.18 E F0 4.3(,w)1.666 G 1.799(hich combines the two pr)238.106 108 R
1.799(eviously acceptable values.)-.18 F(The)6.799 E F1(dirs)72 120 Q F0 2.612
(builtin has acquir)5.112 F 2.613
(ed options to print out speci\214c members of the dir)-.18 F 2.613
(ectory stack.)-.18 F(The)7.613 E F1($nolinks)72 132 Q F0 .177
(variable, which for)2.677 F .176
(ces a physical view of the \214le system, has been superseded by the)-.18 F F1
<ad50>2.676 E F0 1.486(option to the)72 144 R F1(set)3.986 E F0 1.486
(builtin \(equivalent to)3.986 F F1 1.486(set -o physical)3.986 F F0 1.486
(\); the variable is r)B 1.486(etained for backwar)-.18 F(ds)-.18 E
(compatibility)72 156 Q 5.564(.T)-1.11 G .564(he version string contained in)
144.074 156 R F1($BASH_VERSION)3.064 E F0 .563(now includes an indication of)
3.064 F .501(the patch level as well as the `)72 168 R .501(`build version')
-.37 F 3.001('. Some)-.37 F .502(little-used featur)3.001 F .502
(es have been r)-.18 F 3.002(emoved: the)-.18 F F1(bye)72 180 Q F0 .943
(synonym for)3.443 F F1(exit)3.443 E F0 .943(and the)3.443 F F1($NO_PROMPT_V)
3.443 E(ARS)-1.29 E F0 .943(variable ar)3.443 F 3.443(eg)-.18 G 3.443
(one. Ther)379.707 180 R 3.443(ei)-.18 G 3.443(sn)435.873 180 S .942(ow an or)
449.376 180 R(ga-)-.18 E(nized test suite that can be r)72 192 Q(un as a r)-.08
E(egr)-.18 E(ession test when building a new version of Bash.)-.18 E 1.42
(The documentation has been thor)97 207.6 R 1.421(oughly over)-.18 F 1.421
(hauled: ther)-.18 F 3.921(ei)-.18 G 3.921(san)372.184 207.6 S 1.421
(ew manual page on the)395.086 207.6 R -.18(re)72 219.6 S 1.142
(adline library and the).18 F F2(info)3.642 E F0 1.142
(\214le has been updated to r)3.642 F 1.142(e\215ect the curr)-.18 F 1.142
(ent version.)-.18 F 1.141(As always, as)6.142 F
(many bugs as possible have been \214xed, although some sur)72 231.6 Q(ely r)
-.18 E(emain.)-.18 E F1 2.5(5.2. Other)72 255.6 R(Features)2.5 E F0(Ther)97
271.2 Q 3.692(ea)-.18 G 1.552 -.18(re a f)130.992 271.2 T 1.192(ew featur).18 F
1.192(es that I hope to include in later Bash r)-.18 F 3.693(eleases. Some)-.18
F(ar)3.693 E 3.693(eb)-.18 G 1.193(ased on)468.887 271.2 R(work alr)72 283.2 Q
(eady done in other shells.)-.18 E 2.717
(In addition to simple variables, a futur)97 298.8 R 5.217(er)-.18 G 2.716
(elease of Bash will include one-dimensional)297.159 298.8 R .575
(arrays, using the ksh implementation of arrays as a model.)72 310.8 R .575
(Additions to the ksh syntax, such as)5.575 F F2(varname)72 322.8 Q F0 1.116
(=\( ... \) to assign a list of wor)B 1.115(ds dir)-.18 F 1.115
(ectly to an array and a mechanism to allow the)-.18 F F1(read)3.615 E F0 .492
(builtin to r)72 334.8 R .492(ead a list of values dir)-.18 F .493
(ectly into an array)-.18 F 2.993(,w)-1.11 G .493(ould be desirable.)313.615
334.8 R .493(Given those extensions,)5.493 F .621(the ksh)72 346.8 R F1 .621
(set \255A)3.121 F F0 .621(syntax may not be worth supporting \(the)3.121 F F1
<ad41>3.12 E F0 .62(option assigns a list of values to an)3.12 F(array)72 358.8
Q 2.5(,b)-1.11 G(ut is a rather peculiar special case\).)104.88 358.8 Q .522
(Some shells include a means of)97 374.4 R F2(pr)3.022 E(ogrammable)-.18 E F0
(wor)3.022 E 3.022(dc)-.18 G .522(ompletion, wher)331.796 374.4 R 3.023(et)-.18
G .523(he user speci\214es on)416.561 374.4 R 3.291(ap)72 386.4 S(er)86.301
386.4 Q .791(-command basis how the ar)-.18 F .791(guments of the command ar)
-.18 F 3.291(et)-.18 G 3.29(ob)358.98 386.4 S 3.29(et)373.26 386.4 S -.18(re)
384.6 386.4 S .79(ated when completion is).18 F .588
(attempted: as \214lenames, hostnames, executable \214les, and so on.)72 398.4
R .589(The other aspects of the curr)5.589 F(ent)-.18 E .649
(Bash implementation could r)72 410.4 R .648
(emain as-is; the existing heuristics would still be valid.)-.18 F .648
(Only when)5.648 F 2.136(completing the ar)72 422.4 R 2.137
(guments to a simple command would the pr)-.18 F 2.137
(ogrammable completion be in)-.18 F(ef)72 434.4 Q(fect.)-.18 E .223
(It would also be nice to give the user \214ner)97 450 R .223(-grained contr)
-.18 F .222(ol over which commands ar)-.18 F 2.722(es)-.18 G(aved)482.45 450 Q
1.603(onto the history list.)72 462 R 1.604(One pr)6.604 F 1.604
(oposal is for a variable, tentatively named)-.18 F F1(HISTIGNORE)4.104 E F0
4.104(,w)C(hich)485.01 462 Q .471
(would contain a colon-separated list of commands.)72 474 R .471
(Lines beginning with these commands, after)5.471 F .056(the r)72 486 R .056
(estrictions of)-.18 F F1($HISTCONTROL)2.556 E F0 .057
(have been applied, would not be placed onto the history list.)2.556 F 1.246(T\
he shell pattern-matching capabilities could also be available when specifying\
 the contents of)72 498 R F1($HISTIGNORE)72 510 Q F0(.)A .612
(One thing that newer shells such as)97 525.6 R F1(wksh)3.112 E F0 .612
(\(also known as)3.112 F F1(dtksh)3.112 E F0 3.112(\)p)C -.18(ro)397.502 525.6
S .612(vide is a command to).18 F 1.826
(dynamically load code implementing additional builtin commands into a r)72
537.6 R 1.826(unning shell.)-.08 F(This)6.826 E 1.2
(new builtin would take an object \214le or shar)72 549.6 R 1.2
(ed library implementing the `)-.18 F(`body')-.37 E 3.7('o)-.37 G 3.7(ft)450.03
549.6 S 1.2(he builtin)460.32 549.6 R(\()72 561.6 Q F2(xxx_builtin\(\))A F0
1.094(for those familiar with Bash internals\) and a str)3.595 F(uctur)-.08 E
3.594(ec)-.18 G 1.094(ontaining the name of the)386.094 561.6 R .731
(new command, the function to call when the new builtin is invoked \(pr)72
573.6 R .731(esumably de\214ned in the)-.18 F(shar)72 585.6 Q .881
(ed object speci\214ed as an ar)-.18 F .881
(gument\), and the documentation to be printed by the)-.18 F F1(help)3.38 E F0
(com-)3.38 E .974(mand \(possibly pr)72 597.6 R .974(esent in the shar)-.18 F
.975(ed object as well\).)-.18 F .975(It would manage the details of extending)
5.975 F(the internal table of builtins.)72 609.6 Q 2.641(Af)97 625.2 S .141
(ew other builtins would also be desirable: two ar)110.751 625.2 R 2.641(et)
-.18 G .14(he POSIX.2)337.93 625.2 R F1(getconf)2.64 E F0 .14(command, which)
2.64 F 1.518(prints the values of system con\214guration variables de\214ned b\
y POSIX.2, and a)72 637.2 R F1(disown)4.019 E F0(builtin,)4.019 E .93
(which causes a shell r)72 649.2 R .929(unning with job contr)-.08 F .929
(ol active to `)-.18 F(`for)-.37 E .929(get about')-.18 F 3.429('o)-.37 G .929
(ne or mor)397.563 649.2 R 3.429(eb)-.18 G(ackgr)456.25 649.2 Q(ound)-.18 E
.095(jobs in its internal jobs table.)72 661.2 R(Using)5.095 E F1(getconf)2.595
E F0 2.595(,f)C .095(or example, a user could r)274.02 661.2 R .096
(etrieve a value for)-.18 F F1($P)2.596 E -.92(AT)-.74 G(H).92 E F0 .73
(guaranteed to \214nd all of the POSIX standar)72 673.2 R 3.23(du)-.18 G .73
(tilities, or \214nd out how long \214lenames may be in)282.86 673.2 R
(the \214le system containing a speci\214ed dir)72 685.2 Q(ectory)-.18 E(.)
-1.11 E(Ther)97 700.8 Q 4.171(ea)-.18 G 2.031 -.18(re n)131.471 700.8 T 4.171
(oi).18 G 1.671(mplementation timetables for any of these featur)162.563 700.8
R 1.672(es, nor ar)-.18 F 4.172(et)-.18 G(her)443.888 700.8 Q 4.172(ec)-.18 G
(oncr)471.67 700.8 Q(ete)-.18 E .034(plans to include them.)72 712.8 R .034
(If anyone has comments on these pr)5.034 F .034(oposals, feel fr)-.18 F .033
(ee to send me electr)-.18 F(onic)-.18 E(mail.)72 724.8 Q EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-1)277.445 48 S 2.5(1-)287.725 48 S/F1 10
/Palatino-Bold@0 SF 2.5(6. Re\215ections)72 84 R(and Lessons Learned)2.5 E F0
1.503(The lesson that has been r)97 99.6 R 1.504
(epeated most often during Bash development is that ther)-.18 F 4.004(ea)-.18 G
-.18(re)495.44 99.6 S 1.052
(dark corners in the Bourne Shell, and people use all of them.)72 111.6 R 1.051
(In the original description of the)6.052 F 1.37
(Bourne shell, quoting and the shell grammar ar)72 123.6 R 3.87(eb)-.18 G 1.37
(oth poorly speci\214ed and incomplete; subse-)304.61 123.6 R .387
(quent descriptions have not helped much.)72 135.6 R .387(The grammar pr)5.387
F .386(esented in Bourne's paper describing)-.18 F .059
(the shell distributed with the Seventh Edition of)72 147.6 R/F2 9
/Palatino-Roman@0 SF(UNIX)2.559 E F0 2.559<8769>C 2.559(ss)321.048 147.6 S
2.559(of)332.087 147.6 S .059(ar of)343.436 147.6 R 2.559(ft)-.18 G .059
(hat it does not allow the com-)372.704 147.6 R(mand)72 159.6 Q/F3 10/Courier@0
SF(who|wc)2.5 E F0 5(.I)C 2.5(nf)147.13 159.6 S(act, as T)158.78 159.6 Q
(om Duf)-.92 E 2.5(fs)-.18 G(tates:)237.21 159.6 Q .985(Nobody r)97 175.2 R
.984(eally knows what the Bourne shell's grammar is.)-.18 F .984
(Even examination of the)5.984 F(sour)97 187.2 Q(ce code is little help.\210)
-.18 E .782(The POSIX.2 standar)72 202.8 R 3.282(di)-.18 G .782(ncludes a)
177.496 202.8 R/F4 10/Palatino-Italic@0 SF(yacc)3.282 E F0 .782
(grammar that comes close to capturing the Bourne shell's)3.282 F(behavior)72
214.8 Q 3.67(,b)-.74 G 1.17(ut it disallows some constr)122.07 214.8 R 1.169
(ucts which sh accepts without complaint \255 and ther)-.08 F 3.669(ea)-.18 G
-.18(re)495.44 214.8 S .223(scripts out ther)72 226.8 R 2.723(et)-.18 G .223
(hat use them.)149.659 226.8 R .224(It took a few versions and several bug r)
5.223 F .224(eports befor)-.18 F 2.724(eB)-.18 G .224(ash imple-)457.436 226.8
R .427(mented sh-compatible quoting, and ther)72 238.8 R 2.927(ea)-.18 G .787
-.18(re s)264.265 238.8 T .426(till some `).18 F(`legal')-.37 E 2.926('s)-.37 G
2.926(hc)359.87 238.8 S(onstr)373.056 238.8 Q .426(ucts which Bash \215ags as)
-.08 F(syntax err)72 250.8 Q 2.5(ors. Complete)-.18 F
(sh compatibility is a tough nut.)2.5 E .314
(The shell is bigger and slower than I would like, though the curr)97 266.4 R
.314(ent version is substantially)-.18 F 1.507(faster than pr)72 278.4 R
(eviously)-.18 E 6.507(.T)-1.11 G 1.507(he r)185.841 278.4 R 1.507
(eadline library could stand a substantial r)-.18 F 4.006(ewrite. A)-.18 F
(hand-written)4.006 E .574(parser to r)72 290.4 R .574(eplace the curr)-.18 F
(ent)-.18 E F4(yacc)3.074 E F0 .574(-generated one would pr)B .574(obably r)
-.18 F .575(esult in a speedup, and would)-.18 F 1.865(solve one glaring pr)72
302.4 R 4.365(oblem: the)-.18 F 1.864(shell could parse commands in `)4.364 F
(`$\(...\)')-.37 E 4.364('c)-.37 G(onstr)408.058 302.4 Q 1.864(ucts as they ar)
-.08 F(e)-.18 E(enter)72 314.4 Q(ed, rather than r)-.18 E(eporting err)-.18 E
(ors when the constr)-.18 E(uct is expanded.)-.08 E .198(As always, ther)97 330
R 2.698(ei)-.18 G 2.698(ss)176.004 330 S .198(ome chaf)187.182 330 R 2.699(ft)
-.18 G 2.699(og)236.659 330 S 2.699(ow)250.378 330 S .199(ith the wheat.)
266.877 330 R(Ar)5.199 E .199(eas of duplicated functionality need)-.18 F 1.009
(to be cleaned up.)72 342 R(Ther)6.009 E 3.509(ea)-.18 G 1.369 -.18(re s)
189.785 342 T 1.009(everal cases wher).18 F 3.509(eB)-.18 G 1.009(ash tr)
300.041 342 R 1.008(eats a variable specially to enable func-)-.18 F 1.316
(tionality available another way \()72 354 R F1($notify)A F0(vs.)3.816 E F1
1.316(set -o notify)6.316 F F0(and)3.816 E F1($nolinks)3.816 E F0(vs.)3.816 E
F1 1.316(set -o physical)3.816 F F0 3.816(,f)C(or)494.59 354 Q .925
(instance\); the special tr)72 366 R .925
(eatment of the variable name should pr)-.18 F .925(obably be r)-.18 F 3.425
(emoved. A)-.18 F .925(few mor)3.425 F(e)-.18 E 2.296(things could stand r)72
378 R 2.296(emoval; the)-.18 F F1($allow_null_glob_expansion)4.796 E F0(and)
4.796 E F1($glob_dot_\214lenames)4.797 E F0(vari-)4.797 E .728(ables ar)72 390
R 3.228(eo)-.18 G 3.228(fp)119.946 390 S .728(articularly questionable value.)
132.514 390 R(The)5.728 E F1($[...])3.227 E F0 .727
(arithmetic evaluation syntax is r)3.227 F(edundant)-.18 E .804
(now that the POSIX-mandated)72 402 R F1($\(\(...\)\))3.304 E F0(constr)3.304 E
.805(uct has been implemented, and could be deleted.)-.08 F(It)5.805 E 1.056
(would be nice if the text output by the)72 414 R F1(help)3.556 E F0 1.055
(builtin wer)3.556 F 3.555(ee)-.18 G 1.055
(xternal to the shell rather than com-)339.79 414 R 1.365(piled into it.)72 426
R 1.365(The behavior enabled by)6.365 F F1($command_oriented_history)3.865 E F0
3.865(,w)C 1.365(hich causes the shell to)397.55 426 R 1.047
(attempt to save all lines of a multi-line command in a single history entry)72
438 R 3.547(,s)-1.11 G 1.047(hould be made the)418.109 438 R
(default and the variable r)72 450 Q(emoved.)-.18 E F1 2.5(7. A)72 474 R
(vailability)-.7 E F0 6.17(As with all other GNU softwar)97 489.6 R 6.17
(e, Bash is available for anonymous FTP fr)-.18 F(om)-.18 E F4(pr)72 501.6 Q
(ep.ai.mit.edu:/pub/gnu)-.18 E F0 2.136(and fr)6.302 F 2.136
(om other GNU softwar)-.18 F 4.635(em)-.18 G(irr)334.21 501.6 Q 2.135
(or sites.)-.18 F 2.135(The curr)7.135 F 2.135(ent version is in)-.18 F F4
(bash-1.14.1.tar)72 513.6 Q(.gz)-.74 E F0 .241(in that dir)4.407 F(ectory)-.18
E 5.241(.U)-1.11 G(se)234.27 513.6 Q F4(ar)2.741 E(chie)-.18 E F0 .241
(to \214nd the near)4.407 F .241(est ar)-.18 F .241(chive site.)-.18 F .242
(The latest version is)5.241 F .295(always available for FTP fr)72 525.6 R(om)
-.18 E F4(bash.CWRU.Edu:/pub/dist.)2.795 E F0 .295
(Bash documentation is available for FTP)4.461 F(fr)72 537.6 Q(om)-.18 E F4
(bash.CWRU.Edu:/pub/bash.)2.5 E F0 1.207(The Fr)97 553.2 R 1.207(ee Softwar)
-.18 F 3.707(eF)-.18 G 1.207
(oundation sells tapes and CD-ROMs containing Bash; send electr)188.531 553.2 R
(onic)-.18 E(mail to)72 565.2 Q F3(gnu@prep.ai.mit.edu)2.5 E F0(or call)2.5 E
F3(+1-617-876-3296)2.5 E F0(for mor)2.5 E 2.5(ei)-.18 G(nformation.)387.54
565.2 Q .283(Bash is also distributed with several versions of)97 580.8 R F2
(UNIX)2.782 E F0 .282(-compatible systems.)B .282(It is included as)5.282 F
.624(/bin/sh and /bin/bash on several Linux distributions \(mor)72 592.8 R
3.124(ea)-.18 G .624(bout the dif)353.78 592.8 R(fer)-.18 E .624
(ence in a moment\),)-.18 F(and as contributed softwar)72 604.8 Q 2.5(ei)-.18 G
2.5(nB)200.83 604.8 S(SDI's BSD/386* and Fr)215.26 604.8 Q(eeBSD.)-.18 E .529
(The Linux distribution deserves special mention.)97 620.4 R(Ther)5.529 E 3.029
(ea)-.18 G .889 -.18(re t)354.414 620.4 T .529(wo con\214gurations included in)
.18 F .037(the standar)72 632.4 R 2.537(dB)-.18 G .038(ash distribution: a `)
136.364 632.4 R(`normal')-.37 E 2.538('c)-.37 G .038
(on\214guration, in which all of the standar)268.256 632.4 R 2.538(df)-.18 G
(eatur)456.022 632.4 Q .038(es ar)-.18 F(e)-.18 E .451(included, and a `)72
644.4 R(`minimal')-.37 E 2.951('c)-.37 G .451
(on\214guration, which omits job contr)199.384 644.4 R .451
(ol, aliases, history and command)-.18 F .356(line editing, the dir)72 656.4 R
.356(ectory stack and)-.18 F F1(pushd/popd/dirs,)2.856 E F0(pr)2.856 E .357
(ocess substitution, pr)-.18 F .357(ompt string special)-.18 F .32 LW 76 666.4
72 666.4 DL 80 666.4 76 666.4 DL 84 666.4 80 666.4 DL 88 666.4 84 666.4 DL 92
666.4 88 666.4 DL 96 666.4 92 666.4 DL 100 666.4 96 666.4 DL 104 666.4 100
666.4 DL 108 666.4 104 666.4 DL 112 666.4 108 666.4 DL 116 666.4 112 666.4 DL
120 666.4 116 666.4 DL 124 666.4 120 666.4 DL 128 666.4 124 666.4 DL 132 666.4
128 666.4 DL 136 666.4 132 666.4 DL 140 666.4 136 666.4 DL 144 666.4 140 666.4
DL/F5 8/Palatino-Roman@0 SF .42(\207S. R. Bourne, `)72 676.4 R .42(`UNIX T)
-.296 F .42(ime-Sharing System:)-.44 F .42(The UNIX Shell')4.42 F(',)-.296 E/F6
8/Palatino-Italic@0 SF .42(Bell System T)2.42 F .42(echnical Journal)-.888 F F5
2.42(,5)C .42(7\(6\), July-August,)405.004 676.4 R(1978, pp. 1971-1990.)72
686.4 Q<8854>72 696.4 Q .209(om Duf)-.736 F .209(f, `)-.144 F .209
(`Rc \255 A Shell for Plan 9 and)-.296 F/F7 7/Palatino-Roman@0 SF(UNIX)2.209 E
F5(systems')2.209 E(',)-.296 E F6(Pr)2.209 E .208
(oc. of the Summer 1990 EUUG Confer)-.144 F(ence)-.144 E F5 2.208(,L)C .208
(ondon, Ju-)430.704 696.4 R(ly)72 706.4 Q 2(,1)-.888 G(990, pp. 21-33.)85.888
706.4 Q(*BSD/386 is a trademark of Berkeley Softwar)72 716.4 Q 2(eD)-.144 G
(esign, Inc.)243.472 716.4 Q EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Palatino-Roman@0 SF 2.5(-1)277.17 48 S 2.5(2-)288 48 S 1.319
(character decoding, and the)72 84 R/F1 10/Palatino-Italic@0 SF(select)3.818 E
F0(constr)5.484 E 3.818(uct. This)-.08 F 1.318
(minimal version is designed to be a dr)3.818 F(op-in)-.18 E -.18(re)72 96 S
1.292(placement for the traditional).18 F/F2 9/Palatino-Roman@0 SF(UNIX)3.792 E
F0 1.293(/bin/sh, and is included as the Linux /bin/sh in several)3.792 F
(packagings.)72 108 Q/F3 10/Palatino-Bold@0 SF 2.5(8. Conclusion)72 132 R F0
.19(Bash is a worthy successor to sh.)97 147.6 R .19(It is suf)5.19 F .19
(\214ciently portable to r)-.18 F .19(un on nearly every version of)-.08 F F2
(UNIX)72 159.6 Q F0(fr)2.929 E .429(om 4.3 BSD to SVR4.2, and several)-.18 F F2
(UNIX)2.93 E F0 2.93(workalikes. It)2.93 F .43(is r)2.93 F .43
(obust enough to r)-.18 F .43(eplace sh on)-.18 F 1.22
(most of those systems, and pr)72 171.6 R 1.219(ovides mor)-.18 F 3.719(ef)-.18
G(unctionality)271.896 171.6 Q 6.219(.I)-1.11 G 3.719(th)336.255 171.6 S 1.219
(as several thousand r)349.054 171.6 R 1.219(egular users,)-.18 F .052(and the\
ir feedback has helped to make it as good as it is today \255 a testament to t\
he bene\214ts of fr)72 183.6 R(ee)-.18 E(softwar)72 195.6 Q(e.)-.18 E EP
%%Trailer
end
%%EOF