Deleted Added
full compact
sh.1 (50698) sh.1 (51090)
1.\" Copyright (c) 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Kenneth Almquist.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
1.\" Copyright (c) 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Kenneth Almquist.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions

--- 19 unchanged lines hidden (view full) ---

28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
36.\" $FreeBSD: head/bin/sh/sh.1 50698 1999-08-31 12:44:52Z sheldonh $
36.\" $FreeBSD: head/bin/sh/sh.1 51090 1999-09-08 15:40:46Z sheldonh $
37.\"
38.Dd May 5, 1995
39.Dt SH 1
40.Os BSD 4
41.Sh NAME
42.Nm sh
43.Nd command interpreter (shell)
44.Sh SYNOPSIS

--- 18 unchanged lines hidden (view full) ---

63incorporated into this shell.
64This man page is not intended to be a tutorial or a complete
65specification of the shell.
66.Ss Overview
67The shell is a command that reads lines from
68either a file or the terminal, interprets them, and
69generally executes other commands. It is the program that is running
70when a user logs into the system (although a user can select
37.\"
38.Dd May 5, 1995
39.Dt SH 1
40.Os BSD 4
41.Sh NAME
42.Nm sh
43.Nd command interpreter (shell)
44.Sh SYNOPSIS

--- 18 unchanged lines hidden (view full) ---

63incorporated into this shell.
64This man page is not intended to be a tutorial or a complete
65specification of the shell.
66.Ss Overview
67The shell is a command that reads lines from
68either a file or the terminal, interprets them, and
69generally executes other commands. It is the program that is running
70when a user logs into the system (although a user can select
71a different shell with the chsh(1) command).
71a different shell with the
72.Xr chsh 1
73command).
72The shell
73implements a language that has flow control constructs,
74a macro facility that provides a variety of features in
74The shell
75implements a language that has flow control constructs,
76a macro facility that provides a variety of features in
75addition to data storage, along with built in history and line
77addition to data storage, along with builtin history and line
76editing capabilities. It incorporates many features to
77aid interactive use and has the advantage that the interpretative
78language is common to both interactive and non-interactive
79use (shell scripts). That is, commands can be typed directly
80to the running shell or can be put into a file and the file
81can be executed directly by the shell.
82.Ss Invocation
83If no args are present and if the standard input of the shell

--- 46 unchanged lines hidden (view full) ---

130closes a well-known, and sometimes easily exploitable security
131hole related to poorly thought out
132.Ev ENV
133scripts.
134.Ss Argument List Processing
135All of the single letter options to
136.Nm
137have a corresponding name that can be used as an argument to the
78editing capabilities. It incorporates many features to
79aid interactive use and has the advantage that the interpretative
80language is common to both interactive and non-interactive
81use (shell scripts). That is, commands can be typed directly
82to the running shell or can be put into a file and the file
83can be executed directly by the shell.
84.Ss Invocation
85If no args are present and if the standard input of the shell

--- 46 unchanged lines hidden (view full) ---

132closes a well-known, and sometimes easily exploitable security
133hole related to poorly thought out
134.Ev ENV
135scripts.
136.Ss Argument List Processing
137All of the single letter options to
138.Nm
139have a corresponding name that can be used as an argument to the
138.Xr set 1
139builtin (described later). These names are provided next to the
140.Ic set
141builtin command (described later). These names are provided next to the
140single letter option in the descriptions below. Specifying a dash
141.Dq -
142enables the option, while using a plus
143.Dq +
144disables the option. A
145.Dq --
146or plain
147.Dq -
148will stop option processing and will force the remaining
149words on the command line to be treated as arguments.
150.Bl -tag -width Ds
151.It Fl a Li allexport
152Export all variables assigned to.
153.It Fl b Li notify
154Enable asynchronous notification of background job
155completion.
156.Pq UNIMPLEMENTED
157.It Fl C Li noclobber
142single letter option in the descriptions below. Specifying a dash
143.Dq -
144enables the option, while using a plus
145.Dq +
146disables the option. A
147.Dq --
148or plain
149.Dq -
150will stop option processing and will force the remaining
151words on the command line to be treated as arguments.
152.Bl -tag -width Ds
153.It Fl a Li allexport
154Export all variables assigned to.
155.It Fl b Li notify
156Enable asynchronous notification of background job
157completion.
158.Pq UNIMPLEMENTED
159.It Fl C Li noclobber
158Don't overwrite existing files with
160Do not overwrite existing files with
159.Dq > .
160.Pq UNIMPLEMENTED
161.It Fl E Li emacs
161.Dq > .
162.Pq UNIMPLEMENTED
163.It Fl E Li emacs
162Enable the built-in
164Enable the builtin
163.Xr emacs 1
164command line editor (disables
165.Fl V
166if it has been set).
167.It Fl e Li errexit
168If not interactive, exit immediately if any
169untested command fails.
170The exit status of a command is considered to be

--- 30 unchanged lines hidden (view full) ---

201and ignores the contents of the
202.Ev ENV
203variable.
204.It Fl s Li stdin
205Read commands from standard input (set automatically
206if no file arguments are present). This option has
207no effect when set after the shell has already started
208running (i.e. when set with the
165.Xr emacs 1
166command line editor (disables
167.Fl V
168if it has been set).
169.It Fl e Li errexit
170If not interactive, exit immediately if any
171untested command fails.
172The exit status of a command is considered to be

--- 30 unchanged lines hidden (view full) ---

203and ignores the contents of the
204.Ev ENV
205variable.
206.It Fl s Li stdin
207Read commands from standard input (set automatically
208if no file arguments are present). This option has
209no effect when set after the shell has already started
210running (i.e. when set with the
209.Xr set 1
211.Ic set
210command).
211.It Fl T Li asynctraps
212When waiting for a child, execute traps immediately. If this option is
213not set, traps are executed after the child exits, as specified in
214.St -p1003.2
215This nonstandard option is useful for putting guarding shells around
216children that block signals. The surrounding shell may kill the child
217or it may just return control to the tty and leave the child alone,
218like this:
219.Bd -literal -offset indent
220sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
221.Ed
222.Pp
223.It Fl u Li nounset
224Write a message to standard error when attempting
225to expand a variable that is not set, and if the
226shell is not interactive, exit immediately.
227.Pq UNIMPLEMENTED
228.It Fl V Li vi
212command).
213.It Fl T Li asynctraps
214When waiting for a child, execute traps immediately. If this option is
215not set, traps are executed after the child exits, as specified in
216.St -p1003.2
217This nonstandard option is useful for putting guarding shells around
218children that block signals. The surrounding shell may kill the child
219or it may just return control to the tty and leave the child alone,
220like this:
221.Bd -literal -offset indent
222sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
223.Ed
224.Pp
225.It Fl u Li nounset
226Write a message to standard error when attempting
227to expand a variable that is not set, and if the
228shell is not interactive, exit immediately.
229.Pq UNIMPLEMENTED
230.It Fl V Li vi
229Enable the built-in
231Enable the builtin
230.Xr vi 1
231command line editor (disables
232.Fl E
233if it has been set).
234.It Fl v Li verbose
235The shell writes its input to standard error
236as it is read. Useful for debugging.
237.It Fl x Li xtrace

--- 54 unchanged lines hidden (view full) ---

292after a control operator. The following are reserved words:
293.Bd -literal -offset indent
294! { } case do
295done elif else esac fi
296for if then until while
297.Ed
298.Ss Aliases
299An alias is a name and corresponding value set using the
232.Xr vi 1
233command line editor (disables
234.Fl E
235if it has been set).
236.It Fl v Li verbose
237The shell writes its input to standard error
238as it is read. Useful for debugging.
239.It Fl x Li xtrace

--- 54 unchanged lines hidden (view full) ---

294after a control operator. The following are reserved words:
295.Bd -literal -offset indent
296! { } case do
297done elif else esac fi
298for if then until while
299.Ed
300.Ss Aliases
301An alias is a name and corresponding value set using the
300.Xr alias 1
302.Ic alias
301builtin command. Whenever a reserved word may occur (see above),
302and after checking for reserved words, the shell
303checks the word to see if it matches an alias. If it does,
304it replaces it in the input stream with its value. For example,
305if there is an alias called
306.Dq lf
307with the value
308.Dq ls -F ,

--- 113 unchanged lines hidden (view full) ---

422The variables which are explicitly placed in the environment of
423the command (by placing assignments to them before the
424function name) are made local to the function and are set
425to the values given. Then the command given in the function
426definition is executed. The positional parameters are
427restored to their original values when the command completes.
428This all occurs within the current shell.
429.Pp
303builtin command. Whenever a reserved word may occur (see above),
304and after checking for reserved words, the shell
305checks the word to see if it matches an alias. If it does,
306it replaces it in the input stream with its value. For example,
307if there is an alias called
308.Dq lf
309with the value
310.Dq ls -F ,

--- 113 unchanged lines hidden (view full) ---

424The variables which are explicitly placed in the environment of
425the command (by placing assignments to them before the
426function name) are made local to the function and are set
427to the values given. Then the command given in the function
428definition is executed. The positional parameters are
429restored to their original values when the command completes.
430This all occurs within the current shell.
431.Pp
430Shell builtins are executed internally to the shell, without
432Shell builtin commands are executed internally to the shell, without
431spawning a new process.
432.Pp
433spawning a new process.
434.Pp
433Otherwise, if the command name doesn't match a function
434or builtin, the command is searched for as a normal
435Otherwise, if the command name does not match a function
436or builtin command, the command is searched for as a normal
435program in the filesystem (as described in the next section).
436When a normal program is executed, the shell runs the program,
437passing the arguments and the environment to the
438program. If the program is not a normal executable file
439(i.e. if it does not begin with the
440.Qq magic number
441whose
442.Tn ASCII

--- 105 unchanged lines hidden (view full) ---

548to the standard input of command2.
549.Pp
550A ; or <newline> terminator causes the preceding
551AND-OR-list (described next) to be executed sequentially; a & causes
552asynchronous execution of the preceding AND-OR-list.
553.Pp
554Note that unlike some other shells, each process in the
555pipeline is a child of the invoking shell (unless it
437program in the filesystem (as described in the next section).
438When a normal program is executed, the shell runs the program,
439passing the arguments and the environment to the
440program. If the program is not a normal executable file
441(i.e. if it does not begin with the
442.Qq magic number
443whose
444.Tn ASCII

--- 105 unchanged lines hidden (view full) ---

550to the standard input of command2.
551.Pp
552A ; or <newline> terminator causes the preceding
553AND-OR-list (described next) to be executed sequentially; a & causes
554asynchronous execution of the preceding AND-OR-list.
555.Pp
556Note that unlike some other shells, each process in the
557pipeline is a child of the invoking shell (unless it
556is a shell builtin, in which case it executes in the
558is a shell builtin command, in which case it executes in the
557current shell -- but any effect it has on the
558environment is wiped).
559.Ss Background Commands -- &
560If a command is terminated by the control operator ampersand
561(&), the shell executes the command asynchronously -- that is,
562the shell does not wait for
563the command to finish before executing the next command.
564.Pp

--- 170 unchanged lines hidden (view full) ---

735Variables set by the user must have a name consisting solely
736of alphabetics, numerics, and underscores - the first of which
737must not be numeric. A parameter can also be denoted by a number
738or a special character as explained below.
739.Ss Positional Parameters
740A positional parameter is a parameter denoted by a number (n > 0).
741The shell sets these initially to the values of its command line
742arguments that follow the name of the shell script. The
559current shell -- but any effect it has on the
560environment is wiped).
561.Ss Background Commands -- &
562If a command is terminated by the control operator ampersand
563(&), the shell executes the command asynchronously -- that is,
564the shell does not wait for
565the command to finish before executing the next command.
566.Pp

--- 170 unchanged lines hidden (view full) ---

737Variables set by the user must have a name consisting solely
738of alphabetics, numerics, and underscores - the first of which
739must not be numeric. A parameter can also be denoted by a number
740or a special character as explained below.
741.Ss Positional Parameters
742A positional parameter is a parameter denoted by a number (n > 0).
743The shell sets these initially to the values of its command line
744arguments that follow the name of the shell script. The
743.Xr set 1
744builtin can also be used to set or reset them.
745.Ic set
746builtin command can also be used to set or reset them.
745.Ss Special Parameters
746A special parameter is a parameter denoted by one of the following
747special characters. The value of the parameter is listed
748next to its character.
749.Bl -hang
750.It *
751Expands to the positional parameters, starting from one. When
752the expansion occurs within a double-quoted string

--- 233 unchanged lines hidden (view full) ---

986all existing files whose names can be formed by replacing
987each pattern with a string that matches the specified pattern.
988There are two restrictions on this: first, a pattern cannot match
989a string containing a slash, and second,
990a pattern cannot match a string starting with a period
991unless the first character of the pattern is a period.
992The next section describes the patterns used for both
993Pathname Expansion and the
747.Ss Special Parameters
748A special parameter is a parameter denoted by one of the following
749special characters. The value of the parameter is listed
750next to its character.
751.Bl -hang
752.It *
753Expands to the positional parameters, starting from one. When
754the expansion occurs within a double-quoted string

--- 233 unchanged lines hidden (view full) ---

988all existing files whose names can be formed by replacing
989each pattern with a string that matches the specified pattern.
990There are two restrictions on this: first, a pattern cannot match
991a string containing a slash, and second,
992a pattern cannot match a string starting with a period
993unless the first character of the pattern is a period.
994The next section describes the patterns used for both
995Pathname Expansion and the
994.Xr case 1
996.Ic case
995command.
996.Ss Shell Patterns
997A pattern consists of normal characters, which match themselves,
998and meta-characters. The meta-characters are
999.Dq ! ,
1000.Dq * ,
1001.Dq ? ,
1002and

--- 29 unchanged lines hidden (view full) ---

1032.Pp
1033To include a
1034.Dq ]
1035in a character class, make it the first
1036character listed (after the
1037.Dq ! ,
1038if any). To include a
1039minus sign, make it the first or last character listed.
997command.
998.Ss Shell Patterns
999A pattern consists of normal characters, which match themselves,
1000and meta-characters. The meta-characters are
1001.Dq ! ,
1002.Dq * ,
1003.Dq ? ,
1004and

--- 29 unchanged lines hidden (view full) ---

1034.Pp
1035To include a
1036.Dq ]
1037in a character class, make it the first
1038character listed (after the
1039.Dq ! ,
1040if any). To include a
1041minus sign, make it the first or last character listed.
1040.Ss Builtins
1041This section lists the builtin commands which
1042.Ss Builtin Commands
1043This section lists the commands which
1042are builtin because they need to perform some operation
1044are builtin because they need to perform some operation
1043that can't be performed by a separate process. In addition to
1044these, there are several other commands that may be
1045builtin for efficiency (e.g.
1046.Xr printf 1 ,
1047.Xr echo 1 ,
1048.Xr test 1 ,
1049etc).
1045that can not be performed by a separate process. In addition to
1046these, builtin versions of the
1047.Xr printf 1
1048and
1049.Xr echo 1
1050commands are provided for efficiency.
1050.Bl -tag -width Ds
1051.It :
1052A null command that returns a 0 (true) exit value.
1053.It \&. file
1054The commands in the specified file are read and executed by the shell.
1055If
1056.Ar file
1057contains any

--- 9 unchanged lines hidden (view full) ---

1067.Dq name
1068with value
1069.Dq string .
1070If just
1071.Dq name
1072is specified, the value of the alias
1073.Dq name
1074is printed.
1051.Bl -tag -width Ds
1052.It :
1053A null command that returns a 0 (true) exit value.
1054.It \&. file
1055The commands in the specified file are read and executed by the shell.
1056If
1057.Ar file
1058contains any

--- 9 unchanged lines hidden (view full) ---

1068.Dq name
1069with value
1070.Dq string .
1071If just
1072.Dq name
1073is specified, the value of the alias
1074.Dq name
1075is printed.
1075With no arguments, the alias builtin prints the
1076With no arguments, the alias builtin command prints the
1076names and values of all defined aliases (see unalias).
1077.It bg [ job ] ...
1078Continue the specified jobs (or the current job if no
1079jobs are given) in the background.
1080.It command command arg ...
1081Execute the specified builtin command. (This is useful when you
1082have a shell function with the same name
1083as a builtin command.)
1084.It cd [ directory ]
1085Switch to the specified directory (default $HOME).
1086If an entry for CDPATH appears in the environment
1087of the cd command or the shell variable CDPATH is set
1077names and values of all defined aliases (see unalias).
1078.It bg [ job ] ...
1079Continue the specified jobs (or the current job if no
1080jobs are given) in the background.
1081.It command command arg ...
1082Execute the specified builtin command. (This is useful when you
1083have a shell function with the same name
1084as a builtin command.)
1085.It cd [ directory ]
1086Switch to the specified directory (default $HOME).
1087If an entry for CDPATH appears in the environment
1088of the cd command or the shell variable CDPATH is set
1088and the directory name does not begin with a slash,
1089and the directory name does not begin with a slash (/),
1090dot (.) or dot-dot (..),
1089then the directories listed in CDPATH will be
1090searched for the specified directory. The format of
1091CDPATH is the same as that of PATH. In an interactive shell,
1092the cd command will print out the name of
1093the directory that it actually switched to if this is
1094different from the name that the user gave. These
1095may be different either because the CDPATH mechanism
1096was used or because a symbolic link was crossed.
1097.It eval string ...
1098Concatenate all the arguments with spaces. Then
1099re-parse and execute the
1100command.
1101.It exec [ command arg ... ]
1102Unless command is omitted, the shell process is
1103replaced with the specified program (which must be a
1091then the directories listed in CDPATH will be
1092searched for the specified directory. The format of
1093CDPATH is the same as that of PATH. In an interactive shell,
1094the cd command will print out the name of
1095the directory that it actually switched to if this is
1096different from the name that the user gave. These
1097may be different either because the CDPATH mechanism
1098was used or because a symbolic link was crossed.
1099.It eval string ...
1100Concatenate all the arguments with spaces. Then
1101re-parse and execute the
1102command.
1103.It exec [ command arg ... ]
1104Unless command is omitted, the shell process is
1105replaced with the specified program (which must be a
1104real program, not a shell builtin or function). Any
1106real program, not a shell builtin command or function). Any
1105redirections on the exec command are marked as permanent,
1106so that they are not undone when the exec command finishes.
1107.It exit [ exitstatus ]
1108Terminate the shell process. If exitstatus is given
1109it is used as the exit status of the shell; otherwise
1110the exit status of the preceding command is used.
1111.It export name ...
1112The specified names are exported so that they will

--- 5 unchanged lines hidden (view full) ---

1118export name=value
1119.Ed
1120.Pp
1121With no arguments the export command lists the names
1122of all exported variables.
1123.It fc [-e editor] [first [last]]
1124.It fc -l [-nr] [first [last]]
1125.It fc -s [old=new] [first]
1107redirections on the exec command are marked as permanent,
1108so that they are not undone when the exec command finishes.
1109.It exit [ exitstatus ]
1110Terminate the shell process. If exitstatus is given
1111it is used as the exit status of the shell; otherwise
1112the exit status of the preceding command is used.
1113.It export name ...
1114The specified names are exported so that they will

--- 5 unchanged lines hidden (view full) ---

1120export name=value
1121.Ed
1122.Pp
1123With no arguments the export command lists the names
1124of all exported variables.
1125.It fc [-e editor] [first [last]]
1126.It fc -l [-nr] [first [last]]
1127.It fc -s [old=new] [first]
1126The fc builtin lists, or edits and re-executes, commands
1128The fc builtin command lists, or edits and re-executes, commands
1127previously entered to an interactive shell.
1128.Bl -tag -width Ds
1129.It -e editor
1130Use the editor named by editor to edit the commands. The
1131editor string is a command name, subject to search via the
1132PATH variable. The value in the FCEDIT variable
1133is used as a default when -e is not specified. If
1134FCEDIT is null or unset, the value of the EDITOR

--- 157 unchanged lines hidden (view full) ---

1292Setvar is intended to be used in functions that
1293assign values to variables whose names are passed as
1294parameters.)
1295.It shift [ n ]
1296Shift the positional parameters n times. A shift
1297sets the value of $1 to the value of $2, the value of
1298$2 to the value of $3, and so on, decreasing the
1299value of $# by one. If there are zero positional
1129previously entered to an interactive shell.
1130.Bl -tag -width Ds
1131.It -e editor
1132Use the editor named by editor to edit the commands. The
1133editor string is a command name, subject to search via the
1134PATH variable. The value in the FCEDIT variable
1135is used as a default when -e is not specified. If
1136FCEDIT is null or unset, the value of the EDITOR

--- 157 unchanged lines hidden (view full) ---

1294Setvar is intended to be used in functions that
1295assign values to variables whose names are passed as
1296parameters.)
1297.It shift [ n ]
1298Shift the positional parameters n times. A shift
1299sets the value of $1 to the value of $2, the value of
1300$2 to the value of $3, and so on, decreasing the
1301value of $# by one. If there are zero positional
1300parameters, shifting doesn't do anything.
1302parameters, shifting does not do anything.
1301.It trap [ action ] signal ...
1302Cause the shell to parse and execute action when any
1303of the specified signals are received. The signals
1304are specified by signal number. Action may be null
1305or omitted; the former causes the specified signal to
1306be ignored and the latter causes the default action
1307to be taken. When the shell forks off a subshell, it
1308resets trapped (but not ignored) signals to the
1309default action. The trap command has no effect on
1310signals that were ignored on entry to the shell.
1311.It type [name] ...
1312Interpret each name as a command and print the
1313resolution of the command search. Possible resolutions are:
1303.It trap [ action ] signal ...
1304Cause the shell to parse and execute action when any
1305of the specified signals are received. The signals
1306are specified by signal number. Action may be null
1307or omitted; the former causes the specified signal to
1308be ignored and the latter causes the default action
1309to be taken. When the shell forks off a subshell, it
1310resets trapped (but not ignored) signals to the
1311default action. The trap command has no effect on
1312signals that were ignored on entry to the shell.
1313.It type [name] ...
1314Interpret each name as a command and print the
1315resolution of the command search. Possible resolutions are:
1314shell keyword, alias, shell builtin, command, tracked alias
1316shell keyword, alias, shell builtin command, command, tracked alias
1315and not found. For aliases the alias expansion is printed;
1316for commands and tracked aliases the complete pathname of
1317the command is printed.
1318.It ulimit [ -HSacdflmnust ] [ limit ]
1319Set or display resource limits (see
1320.Xr getrlimit 2 ).
1321If
1322.Dq limit

--- 68 unchanged lines hidden (view full) ---

1391exit status of the last process in the job. If the
1392argument is omitted, wait for all jobs to complete
1393and the return an exit status of zero.
1394.El
1395.Ss Commandline Editing
1396When
1397.Nm
1398is being used interactively from a terminal, the current command
1317and not found. For aliases the alias expansion is printed;
1318for commands and tracked aliases the complete pathname of
1319the command is printed.
1320.It ulimit [ -HSacdflmnust ] [ limit ]
1321Set or display resource limits (see
1322.Xr getrlimit 2 ).
1323If
1324.Dq limit

--- 68 unchanged lines hidden (view full) ---

1393exit status of the last process in the job. If the
1394argument is omitted, wait for all jobs to complete
1395and the return an exit status of zero.
1396.El
1397.Ss Commandline Editing
1398When
1399.Nm
1400is being used interactively from a terminal, the current command
1399and the command history (see fc in Builtins) can be edited using vi-mode
1401and the command history (see fc in
1402.Sx Builtin Commands )
1403can be edited using vi-mode
1400command line editing. This mode uses commands similar
1401to a subset of those described in the vi man page.
1402The command 'set -o vi' enables vi-mode editing and places
1403.Nm
1404into vi insert mode. With vi-mode enabled,
1405.Nm
1406can be switched between insert mode and command mode by typing <ESC>.
1407Hitting <return> while in command mode will pass the line to the shell.
1408.Pp
1409Similarly, the 'set -o emacs' command can be used to enable a subset of
1410emacs-style command line editing features.
1411.Sh SEE ALSO
1404command line editing. This mode uses commands similar
1405to a subset of those described in the vi man page.
1406The command 'set -o vi' enables vi-mode editing and places
1407.Nm
1408into vi insert mode. With vi-mode enabled,
1409.Nm
1410can be switched between insert mode and command mode by typing <ESC>.
1411Hitting <return> while in command mode will pass the line to the shell.
1412.Pp
1413Similarly, the 'set -o emacs' command can be used to enable a subset of
1414emacs-style command line editing features.
1415.Sh SEE ALSO
1416.Xr builtin 1 ,
1417.Xr echo 1 ,
1412.Xr expr 1 ,
1418.Xr expr 1 ,
1419.Xr pwd 1 ,
1420.Xr printf 1 ,
1413.Xr test 1
1414.Sh HISTORY
1415A
1416.Nm
1417command appeared in
1418.At V.1 .
1421.Xr test 1
1422.Sh HISTORY
1423A
1424.Nm
1425command appeared in
1426.At V.1 .