Lines Matching +full:in +full:- +full:built
1 .\"-
2 .\" SPDX-License-Identifier: BSD-3-Clause
10 .\" Redistribution and use in source and binary forms, with or without
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 .St -p1003.1
85 a macro facility that provides a variety of features in
86 addition to data storage, along with built-in history and line
90 language is common to both interactive and non-interactive
110 .Pq Ql - ,
113 when the user first logs in.
123 is set on entry to a shell, or is set in the
128 at login time in the
135 variable to some file by placing the following line in the file
144 The first non-option argument specified on the command line
160 closes a well-known, and sometimes easily exploitable security
183 built-in command
184 (described later in the section called
185 .Sx Built-in Commands ) .
187 .Pq Ql -
193 .Dq Li --
195 .Ql -
204 .Bl -tag -width indent
215 Enable the built-in
222 Exit immediately if any untested command fails in non-interactive mode.
244 because it tends to behave in unexpected ways,
245 particularly in larger scripts.
249 A do-nothing option for POSIX compliance.
253 from input when in interactive mode.
261 It is possible to suspend jobs or to have them run in the foreground or
263 In a non-interactive shell,
265 and is useful to place processes in separate process groups.
310 as specified in
311 .St -p1003.2 .
317 .Bd -literal -offset indent
318 sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
328 Enable the built-in
345 Another do-nothing option for POSIX compliance.
348 Change the exit status of a pipeline to the last non-zero exit status of
349 any command in the pipeline, if any.
352 counts as a non-zero exit status,
353 this option may cause non-zero exit status for successful pipelines
372 Keep in mind that this option only accepts a single string as its
373 argument, hence multi-word strings must be quoted.
381 both enable the built-in
384 .Bd -literal -offset indent
385 set -E
386 set -o emacs
391 option displays the current option settings in a human-readable format.
395 in a format suitable for re-input into the shell.
397 The shell reads input in terms of lines from a file and breaks
406 .Bl -tag -width indent
408 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
413 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
415 .It Li <& Ta Li >& Ta Li <<- Ta Li >| Ta \&
428 characters (character code 0) are not allowed in shell input.
435 dollar-single quotes,
437 .Bl -tag -width indent
439 Enclosing characters in single quotes preserves the literal
441 it impossible to put single-quotes in a single-quoted string).
442 .It Dollar-Single Quotes
449 A backslash introduces a C-style escape sequence:
450 .Bl -tag -width xUnnnnnnnn
478 Literal single-quote
480 Literal double-quote
500 UTF-8 locales.
501 They reject code point 0 and UTF-16 surrogates.
504 that byte and the rest of the string until the matching single-quote
520 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
534 .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center
542 built-in command.
546 If it does, it replaces it in the input stream with its value.
550 .Dq Li "ls -F" ,
557 .Dl "ls -F foobar"
571 .Dl "nohup ls -F foobar"
576 Using aliases in scripts is discouraged
581 An alias name may be escaped in a command line, so that it is not
585 an alias name with a backslash to execute a function, built-in, or
593 of this man page (refer to the BNF in the
594 .St -p1003.2
605 .Bl -enum
616 The remaining words are expanded as described in
625 variable assignments recognized in 1) affect the
628 Redirections are performed as described in
639 .D1 Oo Ar n Oc Ar redir-op file
642 .Ar redir-op
649 .Bl -tag -width "1234567890XX" -offset indent
679 .It Oo Ar n Oc Ns Li <&-
687 .It Oo Ar n Oc Ns Li >&-
693 .Dq here-document .
694 .Bd -unfilled -offset indent
696 .Ar here-doc-text
709 .Ar here-doc-text
712 expansion (as described in the section on
715 .Dq Li <<-
720 .Ar here-doc-text
724 built-in commands, and normal programs.
725 The command is searched for (by name) in that order.
726 The three types of commands are all executed in a different way.
733 The variables which are explicitly placed in the environment of
737 Then the command given in the function definition is executed.
742 Shell built-in commands are executed internally to the shell, without
744 There are two kinds of built-in commands: regular and special.
749 Both regular and special builtins can affect the shell in ways
753 or built-in command, the command is searched for as a normal
754 program in the file system (as described in the next section).
762 resulting in an
780 built-in command by that name.
781 If a built-in command is not found,
783 .Bl -enum
788 The shell searches each entry in the
806 with zero for normal or success, and non-zero for failure,
810 Additionally, the built-in commands return exit codes, as does
815 .Li kill -l .
825 .Bl -item -offset indent
831 list or compound-list
866 executes each process in a pipeline with more than one command
871 If the pipeline is not in the background (discussed later),
881 or the last non-zero exit status of any command in the pipeline otherwise.
904 AND-OR-list
905 (described below in the section called
906 .Sx Short-Circuit List Operators )
910 causes asynchronous execution of the preceding AND-OR-list.
914 the shell executes the command in a subshell environment (see
920 The format for running a command in background is:
933 The commands in a
934 list are executed in the order they are written.
939 .Ss Short-Circuit List Operators
943 are AND-OR list operators.
954 .Ss Flow-Control Constructs (if, while, for, case)
958 .Bd -unfilled -offset indent -compact
977 .Bd -unfilled -offset indent -compact
1000 .Bd -unfilled -offset indent -compact
1001 .Ic for Ar variable Op Ic in Ar word ...
1007 .Ic in
1009 .Ic in Li \&"$@\&"
1012 repeatedly with the variable set to each word in turn.
1042 These are implemented as special built-in commands.
1047 .Bd -unfilled -offset indent -compact
1048 .Ic case Ar word Ic in
1063 Then, each pattern is expanded in turn using tilde expansion,
1080 .Bd -literal -offset indent
1086 .Bd -literal -offset indent
1090 The first form executes the commands in a subshell environment.
1092 .Bl -enum
1125 If job control is enabled in an interactive shell,
1126 commands grouped in parentheses can be suspended and continued as a unit.
1129 two open parentheses in sequence should be separated by whitespace.
1135 .Bd -literal -offset indent
1136 { echo -n "hello"; echo " world"; } > greeting
1167 command is implemented as a built-in command.
1169 unless the command is not in a function or a variable name is invalid.
1173 with the same name in the surrounding scope, if there is
1195 .Ql - .
1197 .Ql -
1219 command is implemented as a special built-in command.
1250 built-in commands that have this form.
1262 built-in command can also be used to set or reset them.
1266 They are shown in the following list, exactly as they would appear in input
1267 typed by the user or in the source of a shell script.
1268 .Bl -hang
1272 the expansion occurs within a double-quoted string
1283 the expansion occurs within double-quotes, each positional
1290 is double-quoted.
1304 .Bd -literal -offset indent
1311 .It Li $-
1312 (hyphen) Expands to the current option flags (the single-letter
1316 built-in command, or implicitly
1328 pipeline, the process ID is that of the last command in the
1333 built-in command reports completion of the process.
1345 .Bl -tag -width ".Va HISTSIZE"
1349 built-in.
1353 built-in.
1359 built-in.
1373 used in tilde expansion and as a default directory for the
1375 built-in.
1391 The current line number in the script or function.
1418 unless this variable is in the environment.
1425 unless you are the superuser, in which case it defaults to
1430 .Bl -tag -width indent
1432 The current time in
1442 This system's fully-qualified hostname (FQDN).
1460 Start of a sequence of non-printing characters (used, for example,
1463 End of a sequence of non-printing characters.
1466 The following special and non-printing characters are supported
1467 within the sequence of non-printing characters:
1468 .Bl -tag -width indent
1506 within double-quotes,
1510 .Bl -enum
1522 option is in effect).
1541 username is missing (as in
1557 escaped by a backslash or within a single-quoted or double-quoted
1558 string, and characters in
1560 expansions, are not examined in determining the matching
1564 .Ql - ,
1568 occur within a double-quoted string,
1570 (via double-quotes inside the expansion);
1572 within such parts are also not examined in determining the matching
1583 The parameter name or symbol can be enclosed in braces, which are
1587 If a parameter expansion occurs inside double-quotes:
1588 .Bl -enum
1600 .Bl -tag -width indent
1601 .It Li ${ Ns Ar parameter Ns Li :- Ns Ar word Ns Li }
1627 assigned in this way.
1654 In the parameter expansions shown previously, use of the colon in the
1655 format results in a test for a parameter that is unset or null; omission
1656 of the colon results in a test for a parameter that is only unset.
1661 (unquoted, double-quoted or here-document)
1665 .Bl -tag -width indent
1668 The length in characters of
1685 Enclosing the full parameter expansion string in double-quotes does not
1688 .Bl -tag -width indent
1695 parameter expansion then results in
1705 parameter expansion then results in
1715 parameter expansion then results in
1725 parameter expansion then results in
1731 Command substitution allows the output of a command to be substituted in
1750 and the quoting that is in effect.
1751 The command is executed in a subshell environment,
1752 except that the built-in commands
1761 if they are the only command in a command substitution.
1781 is treated as if it were in double-quotes, except
1782 that a double-quote inside the expression is not treated specially.
1784 shell expands all tokens in the
1793 .Bl -tag -width "Variables" -offset indent
1807 .Li "! ~ + -"
1809 .Li "* / % + - << >> < <= > >= == != & ^ | && ||"\&
1811 .Li "= += -= *= /= %= <<= >>= &= ^= |="
1816 The result of the expression is substituted in decimal.
1821 expansions and substitutions that did not occur in double-quotes for
1824 Characters in
1833 are treated differently from other characters in
1836 Whitespace in
1841 .Bl -enum
1843 a non-whitespace character in
1845 with any whitespace in
1849 one or more whitespace characters in
1853 If a word ends with a non-whitespace character in
1886 and meta-characters.
1887 The meta-characters are
1894 or back quotes are not double-quoted, the value of the
1896 characters and they are turned into meta-characters.
1917 A locale-dependent range of characters may be specified using a minus sign.
1932 has the same effect but is non-standard.
1943 .Ql - ,
1945 .Ss Built-in Commands
1946 This section lists the built-in commands.
1947 .Bl -tag -width indent
1951 The commands in the specified file are read and executed by the shell.
1965 If it is not found in the
1967 it is sought in the current working directory.
1969 A built-in equivalent of
1985 built-in command prints the names and values of all defined aliases
1989 suitable for re-input to the shell.
1999 This command is documented in
2003 .Sx Flow-Control Constructs
2006 Execute the specified built-in command,
2009 with the same name as a built-in command.
2014 to the directory specified in the
2019 to the directory specified in the
2031 then the directories listed in the
2085 built-in command.
2091 ignoring shell functions in the search.
2110 For ordinary commands the output is the path name; for shell built-in
2136 .Sx Flow-Control Constructs
2139 Print a space-separated list of the arguments to the standard output
2141 .Bl -tag -width indent
2145 Process C-style backslash escape sequences.
2149 .Bl -tag -width indent
2155 Suppress the trailing newline (this has the side-effect of truncating the
2178 is not enclosed in quotes then the backslash itself must be escaped
2181 .Bd -literal -offset indent
2182 $ echo -e "a\evb"
2185 $ echo -e a\e\evb
2188 $ echo -e "a\e\eb"
2190 $ echo -e a\e\e\e\eb
2202 Then re-parse and execute the command.
2208 (which must be a real program, not a shell built-in command or function).
2231 appear in the environment of subsequent commands.
2232 The only way to un-export a variable is to
2248 lines, suitable for re-input to the shell.
2250 A null command that returns a non-zero (false) exit value.
2256 built-in command lists, or edits and re-executes,
2258 .Bl -tag -width indent
2269 The value in the
2287 The commands are written in the
2308 Re-execute the command without invoking an editor.
2321 .Bl -tag -width indent
2333 For example, \-1 is the immediately previous command.
2347 .Bl -tag -width ".Va HISTSIZE"
2401 command to delete all the entries in the hash table except for functions.
2403 Print the process IDs of the processes in the specified
2426 A built-in equivalent of
2434 A built-in equivalent of
2438 The built-in command may
2440 built-in command remembers what the current directory
2446 the built-in version of
2470 described in the section on
2473 the pieces are assigned to the variables in order.
2475 pieces (along with the characters in
2491 character will be treated as though it were not in
2541 option is specified, the read-only variables are printed as
2543 lines, suitable for re-input to the shell.
2549 .Oc Op Fl - Ar arg ...
2553 .Bl -item
2558 either in short form or using the long
2561 it sets or clears the specified options as described in the section called
2565 .Dq Fl -
2571 .Dq Fl -
2577 .Dq Fl -
2582 .Pq Ql -
2596 command is intended to be used in functions that
2623 A built-in equivalent of
2638 In addition, the pseudo-signal
2646 .Pq Ql - ;
2709 is not acceptable in this mode.
2714 .Bl -tag -width indent
2716 The maximum size of socket buffer usage, in bytes.
2718 The maximal size of core dump files, in 512-byte blocks.
2723 The maximal size of the data segment of a process, in kilobytes.
2725 The maximal size of a file, in 512-byte blocks.
2732 The maximal size of memory that can be locked by a process, in
2735 The maximal resident set size of a process, in kilobytes.
2739 The maximal number of process-shared locks
2744 The maximal number of pseudo-terminals for this user ID.
2746 The maximal size of the stack segment, in kilobytes.
2748 The maximal amount of CPU time to be used by each process, in seconds.
2752 The maximal virtual size of a process, in kilobytes.
2788 to complete and return the exit status of the last process in the
2806 .Sx Built-in Commands )
2808 .Nm vi Ns -mode
2811 to a subset of those described in the
2815 .Dq Li "set -o vi"
2817 .Dq Li "set -V" )
2819 .Nm vi Ns -mode
2826 .Nm vi Ns -mode
2833 while in command mode will pass the line to the shell.
2836 .Dq Li "set -o emacs"
2838 .Dq Li "set -E" )
2840 .Nm emacs Ns -style
2845 .Bl -tag -width ".Ev LANGXXXXXX"
2851 and is used in a limited manner by the shell itself.
2862 This is inherited by children of the shell, and is used in the history
2871 .Bl -tag -width "/etc/suid_profileXX" -compact
2887 cause the shell to exit with a non-zero exit status.
2915 command, the Thompson shell, appeared in
2917 It was superseded in
2924 was rewritten in 1989 under the
2928 and first appeared in
2938 utility does not recognize multibyte characters other than UTF-8.