]>
Commit | Line | Data |
---|---|---|
1 | .\" | |
2 | .\" Copyright (c) 1999 Sheldon Hearn | |
3 | .\" | |
4 | .\" All rights reserved. | |
5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" | |
15 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
16 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
17 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
18 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
21 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | .\" SUCH DAMAGE. | |
26 | .\" | |
27 | .\" $FreeBSD: /repoman/r/ncvs/src/share/man/man1/builtin.1,v 1.25 2005/09/09 17:02:08 garys Exp $ | |
28 | .\" | |
29 | .Dd February 23, 2005 | |
30 | .Dt BUILTIN 1 | |
31 | .Os | |
32 | .Sh NAME | |
33 | .Nm builtin , | |
34 | .Nm \&! , | |
35 | .Nm \&% , | |
36 | .Nm \&. , | |
37 | .Nm \&: , | |
38 | .Nm \&@ , | |
39 | .Nm \&{ , | |
40 | .Nm \&} , | |
41 | .Nm alias , | |
42 | .Nm alloc , | |
43 | .Nm bg , | |
44 | .Nm bind , | |
45 | .Nm bindkey , | |
46 | .Nm break , | |
47 | .Nm breaksw , | |
48 | .Nm builtins , | |
49 | .Nm case , | |
50 | .Nm cd , | |
51 | .Nm chdir , | |
52 | .Nm command , | |
53 | .Nm complete , | |
54 | .Nm continue , | |
55 | .Nm default , | |
56 | .Nm dirs , | |
57 | .Nm do , | |
58 | .Nm done , | |
59 | .Nm echo , | |
60 | .Nm echotc , | |
61 | .Nm elif , | |
62 | .Nm else , | |
63 | .Nm end , | |
64 | .Nm endif , | |
65 | .Nm endsw , | |
66 | .Nm esac , | |
67 | .Nm eval , | |
68 | .Nm exec , | |
69 | .Nm exit , | |
70 | .Nm export , | |
71 | .Nm false , | |
72 | .Nm fc , | |
73 | .Nm fg , | |
74 | .Nm filetest , | |
75 | .Nm fi , | |
76 | .Nm for , | |
77 | .Nm foreach , | |
78 | .Nm getopts , | |
79 | .Nm glob , | |
80 | .Nm goto , | |
81 | .Nm hash , | |
82 | .Nm hashstat , | |
83 | .Nm history , | |
84 | .Nm hup , | |
85 | .Nm if , | |
86 | .Nm jobid , | |
87 | .Nm jobs , | |
88 | .Nm kill , | |
89 | .Nm limit , | |
90 | .Nm local , | |
91 | .Nm log , | |
92 | .Nm login , | |
93 | .Nm logout , | |
94 | .Nm ls-F , | |
95 | .Nm nice , | |
96 | .Nm nohup , | |
97 | .Nm notify , | |
98 | .Nm onintr , | |
99 | .Nm popd , | |
100 | .Nm printenv , | |
101 | .Nm pushd , | |
102 | .Nm pwd , | |
103 | .Nm read , | |
104 | .Nm readonly , | |
105 | .Nm rehash , | |
106 | .Nm repeat , | |
107 | .Nm return , | |
108 | .Nm sched , | |
109 | .Nm set , | |
110 | .Nm setenv , | |
111 | .Nm settc , | |
112 | .Nm setty , | |
113 | .Nm setvar , | |
114 | .Nm shift , | |
115 | .Nm source , | |
116 | .Nm stop , | |
117 | .Nm suspend , | |
118 | .Nm switch , | |
119 | .Nm telltc , | |
120 | .Nm test , | |
121 | .Nm then , | |
122 | .Nm time , | |
123 | .Nm times , | |
124 | .Nm trap , | |
125 | .Nm true , | |
126 | .Nm type , | |
127 | .Nm ulimit , | |
128 | .Nm umask , | |
129 | .Nm unalias , | |
130 | .Nm uncomplete , | |
131 | .Nm unhash , | |
132 | .Nm unlimit , | |
133 | .Nm unset , | |
134 | .Nm unsetenv , | |
135 | .Nm until , | |
136 | .Nm wait , | |
137 | .Nm where , | |
138 | .Nm which , | |
139 | .Nm while | |
140 | .Nd shell built-in commands | |
141 | .Sh SYNOPSIS | |
142 | .Nm | |
143 | .Op Fl options | |
144 | .Op Ar args ... | |
145 | .Sh DESCRIPTION | |
146 | Shell builtin commands are commands that can be executed within the | |
147 | running shell's process. | |
148 | Note that, in the case of | |
149 | .Xr csh 1 | |
150 | builtin commands, the command is executed in a subshell if it occurs as | |
151 | any component of a pipeline except the last. | |
152 | .Pp | |
153 | If a command specified to the shell contains a slash | |
154 | .Dq \&/ , | |
155 | the shell will not execute a builtin command, even if the last component | |
156 | of the specified command matches the name of a builtin command. | |
157 | Thus, while specifying | |
158 | .Dq Ic echo | |
159 | causes a builtin command to be executed under shells that support the | |
160 | .Nm echo | |
161 | builtin command, | |
162 | specifying | |
163 | .Dq Ic /bin/echo | |
164 | or | |
165 | .Dq Ic ./echo | |
166 | does not. | |
167 | .Pp | |
168 | While some builtin commands may exist in more than one shell, their | |
169 | operation may be different under each shell which supports them. | |
170 | Below is a table which lists shell builtin commands, the standard shells | |
171 | that support them and whether they exist as standalone utilities. | |
172 | .Pp | |
173 | Only builtin commands for the | |
174 | .Xr csh 1 | |
175 | and | |
176 | .Xr sh 1 | |
177 | shells are listed here. | |
178 | Consult a shell's manual page for | |
179 | details on the operation its builtin commands. | |
180 | Beware that the | |
181 | .Xr sh 1 | |
182 | manual page, at least, calls some of these commands | |
183 | .Dq built-in commands | |
184 | and some of them | |
185 | .Dq reserved words . | |
186 | Users of other shells may need to consult an | |
187 | .Xr info 1 | |
188 | page or other sources of documentation. | |
189 | .Pp | |
190 | Commands marked | |
191 | .Dq Li No** | |
192 | under | |
193 | .Em External | |
194 | do exist externally, | |
195 | but are implemented as scripts using a builtin command of the same name. | |
196 | .Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent | |
197 | .It Xo | |
198 | .Em "Command External" Ta Xr csh 1 Ta Xr sh 1 | |
199 | .Xc | |
200 | .It Ic ! Ta \&No Ta \&No Ta \&Yes | |
201 | .It Ic % Ta \&No Ta Yes Ta \&No | |
202 | .It Ic . Ta \&No Ta \&No Ta Yes | |
203 | .It Ic : Ta \&No Ta Yes Ta Yes | |
204 | .It Ic @ Ta \&No Ta Yes Ta Yes | |
205 | .It Ic { Ta \&No Ta \&No Ta \&Yes | |
206 | .It Ic } Ta \&No Ta \&No Ta \&Yes | |
207 | .It Ic alias Ta \&No** Ta Yes Ta Yes | |
208 | .It Ic alloc Ta \&No Ta Yes Ta \&No | |
209 | .It Ic bg Ta No** Ta Yes Ta Yes | |
210 | .It Ic bind Ta \&No Ta \&No Ta Yes | |
211 | .It Ic bindkey Ta \&No Ta Yes Ta \&No | |
212 | .It Ic break Ta \&No Ta Yes Ta \&Yes | |
213 | .It Ic breaksw Ta \&No Ta Yes Ta \&No | |
214 | .It Ic builtin Ta \&No Ta \&No Ta Yes | |
215 | .It Ic builtins Ta \&No Ta Yes Ta \&No | |
216 | .It Ic case Ta \&No Ta Yes Ta Yes | |
217 | .It Ic cd Ta \&No** Ta Yes Ta Yes | |
218 | .It Ic chdir Ta \&No Ta Yes Ta \&Yes | |
219 | .It Ic command Ta \&No** Ta \&No Ta Yes | |
220 | .It Ic complete Ta \&No Ta Yes Ta \&No | |
221 | .It Ic continue Ta \&No Ta Yes Ta \&Yes | |
222 | .It Ic default Ta \&No Ta Yes Ta \&No | |
223 | .It Ic dirs Ta \&No Ta Yes Ta \&No | |
224 | .It Ic do Ta \&No Ta \&No Ta Yes | |
225 | .It Ic done Ta \&No Ta \&No Ta Yes | |
226 | .It Ic echo Ta Yes Ta Yes Ta Yes | |
227 | .It Ic echotc Ta \&No Ta Yes Ta \&No | |
228 | .It Ic elif Ta \&No Ta \&No Ta Yes | |
229 | .It Ic else Ta \&No Ta Yes Ta \&Yes | |
230 | .It Ic end Ta \&No Ta Yes Ta \&No | |
231 | .It Ic endif Ta \&No Ta Yes Ta \&No | |
232 | .It Ic endsw Ta \&No Ta Yes Ta \&No | |
233 | .It Ic esac Ta \&No Ta \&No Ta Yes | |
234 | .It Ic eval Ta \&No Ta Yes Ta Yes | |
235 | .It Ic exec Ta \&No Ta Yes Ta Yes | |
236 | .It Ic exit Ta \&No Ta Yes Ta Yes | |
237 | .It Ic export Ta \&No Ta \&No Ta Yes | |
238 | .It Ic false Ta Yes Ta \&No Ta Yes | |
239 | .It Ic fc Ta \&No** Ta \&No Ta Yes | |
240 | .It Ic fg Ta \&No** Ta Yes Ta Yes | |
241 | .It Ic filetest Ta \&No Ta Yes Ta \&No | |
242 | .It Ic fi Ta \&No Ta \&No Ta Yes | |
243 | .It Ic for Ta \&No Ta \&No Ta Yes | |
244 | .It Ic foreach Ta \&No Ta Yes Ta \&No | |
245 | .It Ic getopts Ta \&No** Ta \&No Ta Yes | |
246 | .It Ic glob Ta \&No Ta Yes Ta \&No | |
247 | .It Ic goto Ta \&No Ta Yes Ta \&No | |
248 | .It Ic hash Ta \&No Ta \&No Ta Yes | |
249 | .It Ic hashstat Ta \&No Ta Yes Ta \&No | |
250 | .It Ic history Ta \&No Ta Yes Ta \&No | |
251 | .It Ic hup Ta \&No Ta Yes Ta \&No | |
252 | .It Ic if Ta \&No Ta Yes Ta \&Yes | |
253 | .It Ic jobid Ta \&No Ta \&No Ta Yes | |
254 | .It Ic jobs Ta \&No** Ta Yes Ta Yes | |
255 | .It Ic kill Ta Yes Ta Yes Ta \&No | |
256 | .It Ic limit Ta \&No Ta Yes Ta \&No | |
257 | .It Ic local Ta \&No Ta \&No Ta Yes | |
258 | .It Ic log Ta \&No Ta Yes Ta \&No | |
259 | .It Ic login Ta Yes Ta Yes Ta \&No | |
260 | .It Ic logout Ta \&No Ta Yes Ta \&No | |
261 | .It Ic ls-F Ta \&No Ta Yes Ta \&No | |
262 | .It Ic nice Ta Yes Ta Yes Ta \&No | |
263 | .It Ic nohup Ta Yes Ta Yes Ta \&No | |
264 | .It Ic notify Ta \&No Ta Yes Ta \&No | |
265 | .It Ic onintr Ta \&No Ta Yes Ta \&No | |
266 | .It Ic popd Ta \&No Ta Yes Ta \&No | |
267 | .It Ic printenv Ta Yes Ta Yes Ta \&No | |
268 | .It Ic pushd Ta \&No Ta Yes Ta \&No | |
269 | .It Ic pwd Ta Yes Ta \&No Ta Yes | |
270 | .It Ic read Ta \&No** Ta \&No Ta Yes | |
271 | .It Ic readonly Ta \&No Ta \&No Ta Yes | |
272 | .It Ic rehash Ta \&No Ta Yes Ta \&No | |
273 | .It Ic repeat Ta \&No Ta Yes Ta \&No | |
274 | .It Ic return Ta \&No Ta \&No Ta Yes | |
275 | .It Ic sched Ta \&No Ta Yes Ta \&No | |
276 | .It Ic set Ta \&No Ta Yes Ta \&Yes | |
277 | .It Ic setenv Ta \&No Ta Yes Ta \&No | |
278 | .It Ic settc Ta \&No Ta Yes Ta \&No | |
279 | .It Ic setty Ta \&No Ta Yes Ta \&No | |
280 | .It Ic setvar Ta \&No Ta \&No Ta Yes | |
281 | .It Ic shift Ta \&No Ta Yes Ta Yes | |
282 | .It Ic source Ta \&No Ta Yes Ta \&No | |
283 | .It Ic stop Ta \&No Ta Yes Ta \&No | |
284 | .It Ic suspend Ta \&No Ta Yes Ta \&No | |
285 | .It Ic switch Ta \&No Ta Yes Ta \&No | |
286 | .It Ic telltc Ta \&No Ta Yes Ta \&No | |
287 | .It Ic test Ta Yes Ta \&No Ta Yes | |
288 | .It Ic then Ta \&No Ta \&No Ta Yes | |
289 | .It Ic time Ta Yes Ta Yes Ta \&No | |
290 | .It Ic times Ta \&No Ta \&No Ta Yes | |
291 | .It Ic trap Ta \&No Ta \&No Ta Yes | |
292 | .It Ic true Ta Yes Ta \&No Ta Yes | |
293 | .It Ic type Ta \&No Ta \&No Ta Yes | |
294 | .It Ic ulimit Ta \&No Ta \&No Ta Yes | |
295 | .It Ic umask Ta \&No** Ta Yes Ta Yes | |
296 | .It Ic unalias Ta \&No** Ta Yes Ta Yes | |
297 | .It Ic uncomplete Ta \&No Ta Yes Ta \&No | |
298 | .It Ic unhash Ta \&No Ta Yes Ta \&No | |
299 | .It Ic unlimit Ta \&No Ta Yes Ta \&No | |
300 | .It Ic unset Ta \&No Ta Yes Ta Yes | |
301 | .It Ic unsetenv Ta \&No Ta Yes Ta \&No | |
302 | .It Ic until Ta \&No Ta \&No Ta Yes | |
303 | .It Ic wait Ta \&No** Ta Yes Ta Yes | |
304 | .It Ic where Ta \&No Ta Yes Ta \&No | |
305 | .It Ic which Ta Yes Ta Yes Ta \&No | |
306 | .It Ic while Ta \&No Ta Yes Ta \&Yes | |
307 | .El | |
308 | .Sh SEE ALSO | |
309 | .Xr csh 1 , | |
310 | .Xr echo 1 , | |
311 | .Xr false 1 , | |
312 | .Xr info 1 , | |
313 | .Xr kill 1 , | |
314 | .Xr login 1 , | |
315 | .Xr nice 1 , | |
316 | .Xr nohup 1 , | |
317 | .Xr printenv 1 , | |
318 | .Xr pwd 1 , | |
319 | .Xr sh 1 , | |
320 | .Xr test 1 , | |
321 | .Xr time 1 , | |
322 | .Xr true 1 , | |
323 | .Xr which 1 | |
324 | .Sh HISTORY | |
325 | The | |
326 | .Nm | |
327 | manual page first appeared in | |
328 | .Fx 3.4 . | |
329 | .Sh AUTHORS | |
330 | This manual page was written by | |
331 | .An Sheldon Hearn Aq sheldonh@FreeBSD.org . |