Commit | Line | Data |
---|---|---|
c9528a00 C |
1 | .bp |
2 | .SH | |
3 | Appendix\ A\ -\ Grammar | |
4 | .LP | |
5 | .DS | |
6 | \fIitem: word | |
7 | input-output | |
8 | name = value | |
9 | .sp 0.8 | |
10 | simple-command: item | |
11 | simple-command item | |
12 | .sp 0.8 | |
13 | command: 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 | |
26 | andor: pipeline | |
27 | andor \fB&&\fI pipeline | |
28 | andor \fB\*(VT\*(VT\fI pipeline | |
29 | .sp 0.8 | |
30 | command-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 | |
36 | input-output: \fB> \fIfile | |
37 | \fB< \fIfile | |
38 | \fB\*(AP \fIword | |
39 | \fB\*(HE \fIword | |
40 | .sp 0.8 | |
41 | file: word | |
42 | \fB&\fI digit | |
43 | \fB&\fI \(mi | |
44 | .sp 0.8 | |
45 | case-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 | |
54 | empty: | |
55 | .sp 0.8 | |
56 | word: \fRa sequence of non-blank characters\fI | |
57 | .sp 0.8 | |
58 | name: \fRa sequence of letters, digits or underscores starting with a letter\fI | |
59 | .sp 0.8 | |
60 | digit: \fB0 1 2 3 4 5 6 7 8 9\fP | |
61 | .DE | |
62 | .LP | |
63 | .bp | |
64 | .SH | |
65 | Appendix\ B\ -\ Meta-characters\ and\ Reserved\ Words | |
66 | .LP | |
67 | a) syntactic | |
68 | .RS | |
69 | .IP \fB\*(VT\fR 6 | |
70 | pipe symbol | |
71 | .IP \fB&&\fR 6 | |
72 | `andf' symbol | |
73 | .IP \fB\*(VT\*(VT\fR 6 | |
74 | `orf' symbol | |
75 | .IP \fB;\fP 6 | |
76 | command separator | |
77 | .IP \fB;;\fP 6 | |
78 | case delimiter | |
79 | .IP \fB&\fP 6 | |
80 | background commands | |
81 | .IP \fB(\ )\fP 6 | |
82 | command grouping | |
83 | .IP \fB<\fP 6 | |
84 | input redirection | |
85 | .IP \fB\*(HE\fP 6 | |
86 | input from a here document | |
87 | .IP \fB>\fP 6 | |
88 | output creation | |
89 | .IP \fB\*(AP\fP 6 | |
90 | output append | |
91 | .sp 2 | |
92 | .RE | |
93 | .LP | |
94 | b) patterns | |
95 | .RS | |
96 | .IP \fB\*(ST\fP 6 | |
97 | match any character(s) including none | |
98 | .IP \fB?\fP 6 | |
99 | match any single character | |
100 | .IP \fB[...]\fP 6 | |
101 | match any of the enclosed characters | |
102 | .sp 2 | |
103 | .RE | |
104 | .LP | |
105 | c) substitution | |
106 | .RS | |
107 | .IP \fB${...}\fP 6 | |
108 | substitute shell variable | |
109 | .IP \fB\`...\`\fP 6 | |
110 | substitute command output | |
111 | .sp 2 | |
112 | .RE | |
113 | .LP | |
114 | d) quoting | |
115 | .RS | |
116 | .IP \fB\e\fP 6 | |
117 | quote the next character | |
118 | .IP \fB\'...\'\fP 6 | |
119 | quote the enclosed characters except for \' | |
120 | .IP \fB"\&..."\fR 6 | |
121 | quote the enclosed characters except | |
122 | for \fB$ \` \e "\fP | |
123 | .sp 2 | |
124 | .RE | |
125 | .LP | |
126 | e) reserved words | |
127 | .DS | |
128 | .ft B | |
129 | if then else elif fi | |
130 | case in esac | |
131 | for while until do done | |
132 | { } | |
133 | .ft | |
134 | .DE |