include problem
[unix-history] / .ref-BSD-3 / usr / doc / shell / t4
CommitLineData
8340f87c
BJ
1.bp
2.SH
3Appendix\ A\ -\ Grammar
4.LP
5.DS
6\fIitem: word
7 input-output
8 name = value
9.sp 0.8
10simple-command: item
11 simple-command item
12.sp 0.8
13command: simple-command
14 \fB( \fIcommand-list \fB)
15 \fB{ \fIcommand-list \fB}
16 \fBfor \fIname \fBdo \fIcommand-list \fBdone
17 \fBfor \fIname \fBin \fIword \*(ZZ \fBdo \fIcommand-list \fBdone
18 \fBwhile \fIcommand-list \fBdo \fIcommand-list \fBdone
19 \fBuntil \fIcommand-list \fBdo \fIcommand-list \fBdone
20 \fBcase \fIword \fBin \fIcase-part \*(ZZ \fBesac
21 \fBif \fIcommand-list \fBthen \fIcommand-list \fIelse-part \fBfi
22.sp 0.8
23\fIpipeline: command
24 pipeline \fB\*(VT\fI command
25.sp 0.8
26andor: pipeline
27 andor \fB&&\fI pipeline
28 andor \fB\*(VT\*(VT\fI pipeline
29.sp 0.8
30command-list: andor
31 command-list \fB;\fI
32 command-list \fB&\fI
33 command-list \fB;\fI andor
34 command-list \fB&\fI andor
35.sp 0.8
36input-output: \fB> \fIfile
37 \fB< \fIfile
38 \fB\*(AP \fIword
39 \fB\*(HE \fIword
40.sp 0.8
41file: word
42 \fB&\fI digit
43 \fB&\fI \(mi
44.sp 0.8
45case-part: pattern\fB ) \fIcommand-list\fB ;;
46.sp 0.8
47\fIpattern: word
48 pattern \fB\*(VT\fI word
49.sp 0.8
50\fIelse-part: \fBelif \fIcommand-list\fB then\fI command-list else-part\fP
51 \fBelse \fIcommand-list\fI
52 empty
53.sp 0.8
54empty:
55.sp 0.8
56word: \fRa sequence of non-blank characters\fI
57.sp 0.8
58name: \fRa sequence of letters, digits or underscores starting with a letter\fI
59.sp 0.8
60digit: \fB0 1 2 3 4 5 6 7 8 9\fP
61.DE
62.LP
63.bp
64.SH
65Appendix\ B\ -\ Meta-characters\ and\ Reserved\ Words
66.LP
67a) syntactic
68.RS
69.IP \fB\*(VT\fR 6
70pipe symbol
71.IP \fB&&\fR 6
72`andf' symbol
73.IP \fB\*(VT\*(VT\fR 6
74`orf' symbol
75.IP \fB;\fP 6
76command separator
77.IP \fB;;\fP 6
78case delimiter
79.IP \fB&\fP 6
80background commands
81.IP \fB(\ )\fP 6
82command grouping
83.IP \fB<\fP 6
84input redirection
85.IP \fB\*(HE\fP 6
86input from a here document
87.IP \fB>\fP 6
88output creation
89.IP \fB\*(AP\fP 6
90output append
91.sp 2
92.RE
93.LP
94b) patterns
95.RS
96.IP \fB\*(ST\fP 6
97match any character(s) including none
98.IP \fB?\fP 6
99match any single character
100.IP \fB[...]\fP 6
101match any of the enclosed characters
102.sp 2
103.RE
104.LP
105c) substitution
106.RS
107.IP \fB${...}\fP 6
108substitute shell variable
109.IP \fB\`...\`\fP 6
110substitute command output
111.sp 2
112.RE
113.LP
114d) quoting
115.RS
116.IP \fB\e\fP 6
117quote the next character
118.IP \fB\'...\'\fP 6
119quote the enclosed characters except for \'
120.IP \fB"\&..."\fR 6
121quote the enclosed characters except
122for \fB$ \` \e "\fP
123.sp 2
124.RE
125.LP
126e) reserved words
127.DS
128.ft B
129if then else elif fi
130case in esac
131for while until do done
132{ }
133.ft
134.DE