xref: /freebsd/share/man/man1/builtin.1 (revision 8fa113e5fc65fe6abc757f0089f477a87ee4d185)
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$
28.\"
29.Dd September 1, 1999
30.Dt BUILTIN 1
31.Os
32.Sh NAME
33.Nm builtin ,
34.Nm alias ,
35.Nm alloc ,
36.Nm bg ,
37.Nm bindkey ,
38.Nm break ,
39.Nm breaksw ,
40.Nm builtins ,
41.Nm case ,
42.Nm cd ,
43.Nm chdir ,
44.Nm command ,
45.Nm complete ,
46.Nm continue ,
47.Nm default ,
48.Nm dirs ,
49.Nm do ,
50.Nm done ,
51.Nm echo ,
52.Nm echotc ,
53.Nm elif ,
54.Nm else ,
55.Nm end ,
56.Nm endif ,
57.Nm endsw ,
58.Nm esac ,
59.Nm eval ,
60.Nm exec ,
61.Nm exit ,
62.Nm export ,
63.Nm false ,
64.Nm fc ,
65.Nm fg ,
66.Nm filetest ,
67.Nm fi ,
68.Nm for ,
69.Nm foreach ,
70.Nm getopts ,
71.Nm glob ,
72.Nm goto ,
73.Nm hash ,
74.Nm hashstat ,
75.Nm history ,
76.Nm hup ,
77.Nm if ,
78.Nm jobid ,
79.Nm jobs ,
80.Nm kill ,
81.Nm limit ,
82.Nm log ,
83.Nm login ,
84.Nm logout ,
85.Nm ls-F ,
86.Nm nice ,
87.Nm nohup ,
88.Nm notify ,
89.Nm onintr ,
90.Nm popd ,
91.Nm printenv ,
92.Nm pushd ,
93.Nm pwd ,
94.Nm read ,
95.Nm readonly ,
96.Nm rehash ,
97.Nm repeat ,
98.Nm sched ,
99.Nm set ,
100.Nm setenv ,
101.Nm settc ,
102.Nm setty ,
103.Nm setvar ,
104.Nm shift ,
105.Nm source ,
106.Nm stop ,
107.Nm suspend ,
108.Nm switch ,
109.Nm telltc ,
110.Nm test ,
111.Nm then ,
112.Nm time ,
113.Nm trap ,
114.Nm true ,
115.Nm type ,
116.Nm ulimit ,
117.Nm umask ,
118.Nm unalias ,
119.Nm uncomplete ,
120.Nm unhash ,
121.Nm unlimit ,
122.Nm unset ,
123.Nm unsetenv ,
124.Nm until ,
125.Nm wait ,
126.Nm where ,
127.Nm which ,
128.Nm while
129.Nd shell builtin commands
130.Sh SYNOPSIS
131.Nm
132.Op Fl options
133.Op Ar args ...
134.Sh DESCRIPTION
135Shell builtin commands are commands that can be executed within the
136running shell's process.
137Note that, in the case of
138.Xr csh 1
139builtin commands, the command is executed in a subshell if it occurs as
140any component of a pipeline except the last.
141.Pp
142If a command specified to the shell contains a slash
143.Dq \&/ ,
144the shell will not execute a builtin command, even if the last component
145of the specified command matches the name of a builtin command.
146Thus, while specifying
147.Dq Ic echo
148causes a builtin command to be executed under shells that support the
149builtin echo command,
150specifying
151.Dq Pa /bin/echo
152or
153.Dq Pa ./echo
154does not.
155.Pp
156While some builtin commands may exist in more than one shell, their
157operation may be different under each shell which supports them.
158Below is a table which lists shell builtin commands, the standard shells
159that support them and whether they exist as standalone utilities.
160.Pp
161Only builtin commands for the
162.Xr csh 1
163and
164.Xr sh 1
165shells are listed here.
166Consult the appropriate manual page for
167details on the operation of any given builtin command under those shells.
168Users of other shells will need to consult the documentation supplied
169with the other shells.
170.Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent
171.It Xo
172.Em "Command	External" Ta Xr csh 1 Ta Xr sh 1
173.Xc
174.It Ic alias Ta \&No Ta Yes Ta Yes
175.It Ic alloc Ta \&No Ta Yes Ta \&No
176.It Ic bg Ta \&No Ta Yes Ta Yes
177.It Ic bindkey Ta \&No Ta Yes Ta \&No
178.It Ic break Ta \&No Ta Yes Ta \&Yes
179.It Ic breaksw Ta \&No Ta Yes Ta \&No
180.It Ic builtins Ta \&No Ta Yes Ta \&No
181.It Ic case Ta \&No Ta Yes Ta Yes
182.It Ic cd Ta \&No Ta Yes Ta Yes
183.It Ic chdir Ta \&No Ta Yes Ta \&Yes
184.It Ic command Ta \&No Ta \&No Ta Yes
185.It Ic complete Ta \&No Ta Yes Ta \&No
186.It Ic continue Ta \&No Ta Yes Ta \&Yes
187.It Ic default Ta \&No Ta Yes Ta \&No
188.It Ic dirs Ta \&No Ta Yes Ta \&No
189.It Ic do Ta \&No Ta \&No Ta Yes
190.It Ic done Ta \&No Ta \&No Ta Yes
191.It Ic echo Ta Yes Ta Yes Ta Yes
192.It Ic echotc Ta \&No Ta Yes Ta \&No
193.It Ic elif Ta \&No Ta \&No Ta Yes
194.It Ic else Ta \&No Ta Yes Ta \&Yes
195.It Ic end Ta \&No Ta Yes Ta \&No
196.It Ic endif Ta \&No Ta Yes Ta \&No
197.It Ic endsw Ta \&No Ta Yes Ta \&No
198.It Ic esac Ta \&No Ta \&No Ta Yes
199.It Ic eval Ta \&No Ta Yes Ta Yes
200.It Ic exec Ta \&No Ta Yes Ta Yes
201.It Ic exit Ta \&No Ta Yes Ta Yes
202.It Ic export Ta \&No Ta \&No Ta Yes
203.It Ic false Ta Yes Ta \&No Ta Yes
204.It Ic fc Ta \&No Ta \&No Ta Yes
205.It Ic fg Ta \&No Ta Yes Ta Yes
206.It Ic filetest Ta \&No Ta Yes Ta \&No
207.It Ic fi Ta \&No Ta \&No Ta Yes
208.It Ic for Ta \&No Ta \&No Ta Yes
209.It Ic foreach Ta \&No Ta Yes Ta \&No
210.It Ic getopts Ta \&No Ta \&No Ta Yes
211.It Ic glob Ta \&No Ta Yes Ta \&No
212.It Ic goto Ta \&No Ta Yes Ta \&No
213.It Ic hash Ta \&No Ta \&No Ta Yes
214.It Ic hashstat Ta \&No Ta Yes Ta \&No
215.It Ic history Ta \&No Ta Yes Ta \&No
216.It Ic hup Ta \&No Ta Yes Ta \&No
217.It Ic if Ta \&No Ta Yes Ta \&Yes
218.It Ic jobid Ta \&No Ta \&No Ta Yes
219.It Ic jobs Ta \&No Ta Yes Ta Yes
220.It Ic kill Ta Yes Ta Yes Ta \&No
221.It Ic limit Ta \&No Ta Yes Ta \&No
222.It Ic log Ta \&No Ta Yes Ta \&No
223.It Ic login Ta Yes Ta Yes Ta \&No
224.It Ic logout Ta \&No Ta Yes Ta \&No
225.It Ic ls-F Ta \&No Ta Yes Ta \&No
226.It Ic nice Ta Yes Ta Yes Ta \&No
227.It Ic nohup Ta Yes Ta Yes Ta \&No
228.It Ic notify Ta \&No Ta Yes Ta \&No
229.It Ic onintr Ta \&No Ta Yes Ta \&No
230.It Ic popd Ta \&No Ta Yes Ta \&No
231.It Ic printenv Ta Yes Ta Yes Ta \&No
232.It Ic pushd Ta \&No Ta Yes Ta \&No
233.It Ic pwd Ta Yes Ta \&No Ta Yes
234.It Ic read Ta \&No Ta \&No Ta Yes
235.It Ic readonly Ta \&No Ta \&No Ta Yes
236.It Ic rehash Ta \&No Ta Yes Ta \&No
237.It Ic repeat Ta \&No Ta Yes Ta \&No
238.It Ic sched Ta \&No Ta Yes Ta \&No
239.It Ic set Ta \&No Ta Yes Ta \&Yes
240.It Ic setenv Ta \&No Ta Yes Ta \&No
241.It Ic settc Ta \&No Ta Yes Ta \&No
242.It Ic setty Ta \&No Ta Yes Ta \&No
243.It Ic setvar Ta \&No Ta \&No Ta Yes
244.It Ic shift Ta \&No Ta Yes Ta Yes
245.It Ic source Ta \&No Ta Yes Ta \&No
246.It Ic stop Ta \&No Ta Yes Ta \&No
247.It Ic suspend Ta \&No Ta Yes Ta \&No
248.It Ic switch Ta \&No Ta Yes Ta \&No
249.It Ic telltc Ta \&No Ta Yes Ta \&No
250.It Ic test Ta Yes Ta \&No Ta Yes
251.It Ic then Ta \&No Ta \&No Ta Yes
252.It Ic time Ta Yes Ta Yes Ta \&No
253.It Ic trap Ta \&No Ta \&No Ta Yes
254.It Ic true Ta Yes Ta \&No Ta Yes
255.It Ic type Ta \&No Ta \&No Ta Yes
256.It Ic ulimit Ta \&No Ta \&No Ta Yes
257.It Ic umask Ta \&No Ta Yes Ta Yes
258.It Ic unalias Ta \&No Ta Yes Ta Yes
259.It Ic uncomplete Ta \&No Ta Yes Ta \&No
260.It Ic unhash Ta \&No Ta Yes Ta \&No
261.It Ic unlimit Ta \&No Ta Yes Ta \&No
262.It Ic unset Ta \&No Ta Yes Ta Yes
263.It Ic unsetenv Ta \&No Ta Yes Ta \&No
264.It Ic until Ta \&No Ta \&No Ta Yes
265.It Ic wait Ta \&No Ta Yes Ta Yes
266.It Ic where Ta \&No Ta Yes Ta \&No
267.It Ic which Ta Yes Ta Yes Ta \&No
268.It Ic while Ta \&No Ta Yes Ta \&Yes
269.El
270.Sh SEE ALSO
271.Xr csh 1 ,
272.Xr echo 1 ,
273.Xr false 1 ,
274.Xr kill 1 ,
275.Xr login 1 ,
276.Xr nice 1 ,
277.Xr nohup 1 ,
278.Xr printenv 1 ,
279.Xr pwd 1 ,
280.Xr sh 1 ,
281.Xr test 1 ,
282.Xr time 1 ,
283.Xr true 1 ,
284.Xr which 1
285.Sh HISTORY
286The
287.Nm
288manual page first appeared in
289.Fx 3.4 .
290.Sh AUTHORS
291This manual page was written by
292.An Sheldon Hearn Aq sheldonh@FreeBSD.org .
293