1999-09-08 15:40:46 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1999 Sheldon Hearn
|
|
|
|
.\"
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
|
|
|
.Dd September 1, 1999
|
|
|
|
.Dt BUILTIN 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm builtin ,
|
|
|
|
.Nm alias ,
|
|
|
|
.Nm alloc ,
|
|
|
|
.Nm bg ,
|
2002-07-23 14:38:07 +00:00
|
|
|
.Nm bind ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm bindkey ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm break ,
|
|
|
|
.Nm breaksw ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm builtins ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm case ,
|
|
|
|
.Nm cd ,
|
|
|
|
.Nm chdir ,
|
|
|
|
.Nm command ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm complete ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm continue ,
|
|
|
|
.Nm default ,
|
|
|
|
.Nm dirs ,
|
|
|
|
.Nm do ,
|
|
|
|
.Nm done ,
|
|
|
|
.Nm echo ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm echotc ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm elif ,
|
|
|
|
.Nm else ,
|
|
|
|
.Nm end ,
|
|
|
|
.Nm endif ,
|
|
|
|
.Nm endsw ,
|
|
|
|
.Nm esac ,
|
|
|
|
.Nm eval ,
|
|
|
|
.Nm exec ,
|
|
|
|
.Nm exit ,
|
|
|
|
.Nm export ,
|
2001-11-17 19:10:11 +00:00
|
|
|
.Nm false ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm fc ,
|
|
|
|
.Nm fg ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm filetest ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm fi ,
|
|
|
|
.Nm for ,
|
|
|
|
.Nm foreach ,
|
|
|
|
.Nm getopts ,
|
|
|
|
.Nm glob ,
|
|
|
|
.Nm goto ,
|
|
|
|
.Nm hash ,
|
|
|
|
.Nm hashstat ,
|
|
|
|
.Nm history ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm hup ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm if ,
|
|
|
|
.Nm jobid ,
|
|
|
|
.Nm jobs ,
|
|
|
|
.Nm kill ,
|
|
|
|
.Nm limit ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm log ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm login ,
|
|
|
|
.Nm logout ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm ls-F ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm nice ,
|
|
|
|
.Nm nohup ,
|
|
|
|
.Nm notify ,
|
|
|
|
.Nm onintr ,
|
|
|
|
.Nm popd ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm printenv ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm pushd ,
|
|
|
|
.Nm pwd ,
|
2000-03-01 14:13:29 +00:00
|
|
|
.Nm read ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm readonly ,
|
|
|
|
.Nm rehash ,
|
|
|
|
.Nm repeat ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm sched ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm set ,
|
|
|
|
.Nm setenv ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm settc ,
|
|
|
|
.Nm setty ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm setvar ,
|
|
|
|
.Nm shift ,
|
|
|
|
.Nm source ,
|
|
|
|
.Nm stop ,
|
|
|
|
.Nm suspend ,
|
|
|
|
.Nm switch ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm telltc ,
|
2001-11-17 19:10:11 +00:00
|
|
|
.Nm test ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm then ,
|
|
|
|
.Nm time ,
|
|
|
|
.Nm trap ,
|
2001-11-17 19:10:11 +00:00
|
|
|
.Nm true ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm type ,
|
|
|
|
.Nm ulimit ,
|
|
|
|
.Nm umask ,
|
|
|
|
.Nm unalias ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm uncomplete ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm unhash ,
|
|
|
|
.Nm unlimit ,
|
|
|
|
.Nm unset ,
|
|
|
|
.Nm unsetenv ,
|
|
|
|
.Nm until ,
|
|
|
|
.Nm wait ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Nm where ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Nm which ,
|
|
|
|
.Nm while
|
|
|
|
.Nd shell builtin commands
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1999-09-08 15:40:46 +00:00
|
|
|
.Op Fl options
|
|
|
|
.Op Ar args ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
Shell builtin commands are commands that can be executed within the
|
|
|
|
running shell's process.
|
|
|
|
Note that, in the case of
|
|
|
|
.Xr csh 1
|
|
|
|
builtin commands, the command is executed in a subshell if it occurs as
|
|
|
|
any component of a pipeline except the last.
|
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
If a command specified to the shell contains a slash
|
1999-09-08 15:40:46 +00:00
|
|
|
.Dq \&/ ,
|
|
|
|
the shell will not execute a builtin command, even if the last component
|
1999-09-14 11:46:04 +00:00
|
|
|
of the specified command matches the name of a builtin command.
|
|
|
|
Thus, while specifying
|
1999-09-08 15:40:46 +00:00
|
|
|
.Dq Ic echo
|
|
|
|
causes a builtin command to be executed under shells that support the
|
|
|
|
builtin echo command,
|
|
|
|
specifying
|
|
|
|
.Dq Pa /bin/echo
|
|
|
|
or
|
|
|
|
.Dq Pa ./echo
|
|
|
|
does not.
|
|
|
|
.Pp
|
|
|
|
While some builtin commands may exist in more than one shell, their
|
|
|
|
operation may be different under each shell which supports them.
|
|
|
|
Below is a table which lists shell builtin commands, the standard shells
|
|
|
|
that support them and whether they exist as standalone utilities.
|
|
|
|
.Pp
|
|
|
|
Only builtin commands for the
|
|
|
|
.Xr csh 1
|
|
|
|
and
|
|
|
|
.Xr sh 1
|
1999-09-14 11:46:04 +00:00
|
|
|
shells are listed here.
|
|
|
|
Consult the appropriate manual page for
|
1999-09-08 15:40:46 +00:00
|
|
|
details on the operation of any given builtin command under those shells.
|
|
|
|
Users of other shells will need to consult the documentation supplied
|
|
|
|
with the other shells.
|
2001-08-08 11:48:28 +00:00
|
|
|
.Bl -column ".Ic uncomplete" ".Em External" ".Xr csh 1" ".Xr sh 1" -offset indent
|
2000-05-08 15:59:23 +00:00
|
|
|
.It Xo
|
2001-01-22 10:44:54 +00:00
|
|
|
.Em "Command External" Ta Xr csh 1 Ta Xr sh 1
|
|
|
|
.Xc
|
2002-07-17 15:34:25 +00:00
|
|
|
.It Ic alias Ta Yes Ta Yes Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic alloc Ta \&No Ta Yes Ta \&No
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic bg Ta Yes Ta Yes Ta Yes
|
2002-07-23 14:38:07 +00:00
|
|
|
.It Ic bind Ta \&No Ta \&No Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic bindkey Ta \&No Ta Yes Ta \&No
|
2001-04-25 05:53:20 +00:00
|
|
|
.It Ic break Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic breaksw Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic builtins Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic case Ta \&No Ta Yes Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic cd Ta Yes Ta Yes Ta Yes
|
2001-04-25 05:53:20 +00:00
|
|
|
.It Ic chdir Ta \&No Ta Yes Ta \&Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic command Ta Yes Ta \&No Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic complete Ta \&No Ta Yes Ta \&No
|
2001-04-25 05:53:20 +00:00
|
|
|
.It Ic continue Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic default Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic dirs Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic do Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic done Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic echo Ta Yes Ta Yes Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic echotc Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic elif Ta \&No Ta \&No Ta Yes
|
2001-04-25 05:53:20 +00:00
|
|
|
.It Ic else Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic end Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic endif Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic endsw Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic esac Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic eval Ta \&No Ta Yes Ta Yes
|
|
|
|
.It Ic exec Ta \&No Ta Yes Ta Yes
|
|
|
|
.It Ic exit Ta \&No Ta Yes Ta Yes
|
|
|
|
.It Ic export Ta \&No Ta \&No Ta Yes
|
2001-11-17 19:10:11 +00:00
|
|
|
.It Ic false Ta Yes Ta \&No Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic fc Ta Yes Ta \&No Ta Yes
|
|
|
|
.It Ic fg Ta Yes Ta Yes Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic filetest Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic fi Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic for Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic foreach Ta \&No Ta Yes Ta \&No
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic getopts Ta Yes Ta \&No Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic glob Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic goto Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic hash Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic hashstat Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic history Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic hup Ta \&No Ta Yes Ta \&No
|
2001-04-01 01:08:33 +00:00
|
|
|
.It Ic if Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic jobid Ta \&No Ta \&No Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic jobs Ta Yes Ta Yes Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic kill Ta Yes Ta Yes Ta \&No
|
|
|
|
.It Ic limit Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic log Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic login Ta Yes Ta Yes Ta \&No
|
|
|
|
.It Ic logout Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic ls-F Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic nice Ta Yes Ta Yes Ta \&No
|
|
|
|
.It Ic nohup Ta Yes Ta Yes Ta \&No
|
|
|
|
.It Ic notify Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic onintr Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic popd Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic printenv Ta Yes Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic pushd Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic pwd Ta Yes Ta \&No Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic read Ta Yes Ta \&No Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic readonly Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic rehash Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic repeat Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic sched Ta \&No Ta Yes Ta \&No
|
1999-12-20 16:29:56 +00:00
|
|
|
.It Ic set Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic setenv Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic settc Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic setty Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic setvar Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic shift Ta \&No Ta Yes Ta Yes
|
|
|
|
.It Ic source Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic stop Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic suspend Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic switch Ta \&No Ta Yes Ta \&No
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic telltc Ta \&No Ta Yes Ta \&No
|
2001-11-17 19:10:11 +00:00
|
|
|
.It Ic test Ta Yes Ta \&No Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic then Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic time Ta Yes Ta Yes Ta \&No
|
|
|
|
.It Ic trap Ta \&No Ta \&No Ta Yes
|
2001-11-17 19:10:11 +00:00
|
|
|
.It Ic true Ta Yes Ta \&No Ta Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic type Ta \&No Ta \&No Ta Yes
|
|
|
|
.It Ic ulimit Ta \&No Ta \&No Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic umask Ta Yes Ta Yes Ta Yes
|
|
|
|
.It Ic unalias Ta Yes Ta Yes Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic uncomplete Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic unhash Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic unlimit Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic unset Ta \&No Ta Yes Ta Yes
|
|
|
|
.It Ic unsetenv Ta \&No Ta Yes Ta \&No
|
|
|
|
.It Ic until Ta \&No Ta \&No Ta Yes
|
2002-07-17 07:12:37 +00:00
|
|
|
.It Ic wait Ta Yes Ta Yes Ta Yes
|
2000-05-09 14:59:06 +00:00
|
|
|
.It Ic where Ta \&No Ta Yes Ta \&No
|
1999-09-08 15:40:46 +00:00
|
|
|
.It Ic which Ta Yes Ta Yes Ta \&No
|
2001-04-25 05:53:20 +00:00
|
|
|
.It Ic while Ta \&No Ta Yes Ta \&Yes
|
1999-09-08 15:40:46 +00:00
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr csh 1 ,
|
|
|
|
.Xr echo 1 ,
|
2001-11-20 13:05:53 +00:00
|
|
|
.Xr false 1 ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Xr kill 1 ,
|
|
|
|
.Xr login 1 ,
|
|
|
|
.Xr nice 1 ,
|
|
|
|
.Xr nohup 1 ,
|
2000-05-09 14:59:06 +00:00
|
|
|
.Xr printenv 1 ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Xr pwd 1 ,
|
|
|
|
.Xr sh 1 ,
|
2001-11-20 13:05:53 +00:00
|
|
|
.Xr test 1 ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Xr time 1 ,
|
2001-11-20 13:05:53 +00:00
|
|
|
.Xr true 1 ,
|
1999-09-08 15:40:46 +00:00
|
|
|
.Xr which 1
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
manual page first appeared in
|
2000-03-03 09:28:05 +00:00
|
|
|
.Fx 3.4 .
|
1999-09-08 15:40:46 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
This manual page was written by
|
|
|
|
.An Sheldon Hearn Aq sheldonh@FreeBSD.org .
|