Lines Matching +full:built +full:- +full:in

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.
241 Note that many commands return non-zero values to convey information other
247 A do-nothing option for POSIX compliance.
251 from input when in interactive mode.
259 It is possible to suspend jobs or to have them run in the foreground or
261 In a non-interactive shell,
263 and is useful to place processes in separate process groups.
308 as specified in
309 .St -p1003.2 .
315 .Bd -literal -offset indent
316 sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
326 Enable the built-in
343 Another do-nothing option for POSIX compliance.
346 Change the exit status of a pipeline to the last non-zero exit status of
347 any command in the pipeline, if any.
350 counts as a non-zero exit status,
351 this option may cause non-zero exit status for successful pipelines
370 Keep in mind that this option only accepts a single string as its
371 argument, hence multi-word strings must be quoted.
379 both enable the built-in
382 .Bd -literal -offset indent
383 set -E
384 set -o emacs
389 option displays the current option settings in a human-readable format.
393 in a format suitable for re-input into the shell.
395 The shell reads input in terms of lines from a file and breaks
404 .Bl -tag -width indent
406 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
411 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
413 .It Li <& Ta Li >& Ta Li <<- Ta Li >| Ta \&
426 characters (character code 0) are not allowed in shell input.
433 dollar-single quotes,
435 .Bl -tag -width indent
437 Enclosing characters in single quotes preserves the literal
439 it impossible to put single-quotes in a single-quoted string).
440 .It Dollar-Single Quotes
447 A backslash introduces a C-style escape sequence:
448 .Bl -tag -width xUnnnnnnnn
476 Literal single-quote
478 Literal double-quote
498 UTF-8 locales.
499 They reject code point 0 and UTF-16 surrogates.
502 that byte and the rest of the string until the matching single-quote
518 .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
532 .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center
540 built-in command.
544 If it does, it replaces it in the input stream with its value.
548 .Dq Li "ls -F" ,
555 .Dl "ls -F foobar"
569 .Dl "nohup ls -F foobar"
574 Using aliases in scripts is discouraged
579 An alias name may be escaped in a command line, so that it is not
583 an alias name with a backslash to execute a function, built-in, or
591 of this man page (refer to the BNF in the
592 .St -p1003.2
603 .Bl -enum
614 The remaining words are expanded as described in
623 variable assignments recognized in 1) affect the
626 Redirections are performed as described in
637 .D1 Oo Ar n Oc Ar redir-op file
640 .Ar redir-op
647 .Bl -tag -width "1234567890XX" -offset indent
677 .It Oo Ar n Oc Ns Li <&-
685 .It Oo Ar n Oc Ns Li >&-
691 .Dq here-document .
692 .Bd -unfilled -offset indent
694 .Ar here-doc-text
707 .Ar here-doc-text
710 expansion (as described in the section on
713 .Dq Li <<-
718 .Ar here-doc-text
722 built-in commands, and normal programs.
723 The command is searched for (by name) in that order.
724 The three types of commands are all executed in a different way.
731 The variables which are explicitly placed in the environment of
735 Then the command given in the function definition is executed.
740 Shell built-in commands are executed internally to the shell, without
742 There are two kinds of built-in commands: regular and special.
747 Both regular and special builtins can affect the shell in ways
751 or built-in command, the command is searched for as a normal
752 program in the file system (as described in the next section).
760 resulting in an
778 built-in command by that name.
779 If a built-in command is not found,
781 .Bl -enum
786 The shell searches each entry in the
804 with zero for normal or success, and non-zero for failure,
808 Additionally, the built-in commands return exit codes, as does
813 .Li kill -l .
823 .Bl -item -offset indent
829 list or compound-list
864 executes each process in a pipeline with more than one command
869 If the pipeline is not in the background (discussed later),
879 or the last non-zero exit status of any command in the pipeline otherwise.
902 AND-OR-list
903 (described below in the section called
904 .Sx Short-Circuit List Operators )
908 causes asynchronous execution of the preceding AND-OR-list.
912 the shell executes the command in a subshell environment (see
918 The format for running a command in background is:
931 The commands in a
932 list are executed in the order they are written.
937 .Ss Short-Circuit List Operators
941 are AND-OR list operators.
952 .Ss Flow-Control Constructs (if, while, for, case)
956 .Bd -unfilled -offset indent -compact
975 .Bd -unfilled -offset indent -compact
998 .Bd -unfilled -offset indent -compact
999 .Ic for Ar variable Op Ic in Ar word ...
1005 .Ic in
1007 .Ic in Li \&"$@\&"
1010 repeatedly with the variable set to each word in turn.
1040 These are implemented as special built-in commands.
1045 .Bd -unfilled -offset indent -compact
1046 .Ic case Ar word Ic in
1061 Then, each pattern is expanded in turn using tilde expansion,
1078 .Bd -literal -offset indent
1084 .Bd -literal -offset indent
1088 The first form executes the commands in a subshell environment.
1090 .Bl -enum
1123 If job control is enabled in an interactive shell,
1124 commands grouped in parentheses can be suspended and continued as a unit.
1127 two open parentheses in sequence should be separated by whitespace.
1133 .Bd -literal -offset indent
1134 { echo -n "hello"; echo " world"; } > greeting
1165 command is implemented as a built-in command.
1167 unless the command is not in a function or a variable name is invalid.
1171 with the same name in the surrounding scope, if there is
1193 .Ql - .
1195 .Ql -
1217 command is implemented as a special built-in command.
1248 built-in commands that have this form.
1260 built-in command can also be used to set or reset them.
1264 They are shown in the following list, exactly as they would appear in input
1265 typed by the user or in the source of a shell script.
1266 .Bl -hang
1270 the expansion occurs within a double-quoted string
1281 the expansion occurs within double-quotes, each positional
1288 is double-quoted.
1302 .Bd -literal -offset indent
1309 .It Li $-
1310 (hyphen) Expands to the current option flags (the single-letter
1314 built-in command, or implicitly
1326 pipeline, the process ID is that of the last command in the
1331 built-in command reports completion of the process.
1343 .Bl -tag -width ".Va HISTSIZE"
1347 built-in.
1351 built-in.
1357 built-in.
1371 used in tilde expansion and as a default directory for the
1373 built-in.
1389 The current line number in the script or function.
1416 unless this variable is in the environment.
1423 unless you are the superuser, in which case it defaults to
1428 .Bl -tag -width indent
1430 The current time in
1440 This system's fully-qualified hostname (FQDN).
1458 Start of a sequence of non-printing characters (used, for example,
1461 End of a sequence of non-printing characters.
1464 The following special and non-printing characters are supported
1465 within the sequence of non-printing characters:
1466 .Bl -tag -width indent
1504 within double-quotes,
1508 .Bl -enum
1520 option is in effect).
1539 username is missing (as in
1555 escaped by a backslash or within a single-quoted or double-quoted
1556 string, and characters in
1558 expansions, are not examined in determining the matching
1562 .Ql - ,
1566 occur within a double-quoted string,
1568 (via double-quotes inside the expansion);
1570 within such parts are also not examined in determining the matching
1581 The parameter name or symbol can be enclosed in braces, which are
1585 If a parameter expansion occurs inside double-quotes:
1586 .Bl -enum
1598 .Bl -tag -width indent
1599 .It Li ${ Ns Ar parameter Ns Li :- Ns Ar word Ns Li }
1625 assigned in this way.
1652 In the parameter expansions shown previously, use of the colon in the
1653 format results in a test for a parameter that is unset or null; omission
1654 of the colon results in a test for a parameter that is only unset.
1659 (unquoted, double-quoted or here-document)
1663 .Bl -tag -width indent
1666 The length in characters of
1683 Enclosing the full parameter expansion string in double-quotes does not
1686 .Bl -tag -width indent
1693 parameter expansion then results in
1703 parameter expansion then results in
1713 parameter expansion then results in
1723 parameter expansion then results in
1729 Command substitution allows the output of a command to be substituted in
1748 and the quoting that is in effect.
1749 The command is executed in a subshell environment,
1750 except that the built-in commands
1759 if they are the only command in a command substitution.
1779 is treated as if it were in double-quotes, except
1780 that a double-quote inside the expression is not treated specially.
1782 shell expands all tokens in the
1791 .Bl -tag -width "Variables" -offset indent
1805 .Li "! ~ + -"
1807 .Li "* / % + - << >> < <= > >= == != & ^ | && ||"\&
1809 .Li "= += -= *= /= %= <<= >>= &= ^= |="
1814 The result of the expression is substituted in decimal.
1819 expansions and substitutions that did not occur in double-quotes for
1822 Characters in
1831 are treated differently from other characters in
1834 Whitespace in
1839 .Bl -enum
1841 a non-whitespace character in
1843 with any whitespace in
1847 one or more whitespace characters in
1851 If a word ends with a non-whitespace character in
1884 and meta-characters.
1885 The meta-characters are
1892 or back quotes are not double-quoted, the value of the
1894 characters and they are turned into meta-characters.
1915 A locale-dependent range of characters may be specified using a minus sign.
1930 has the same effect but is non-standard.
1941 .Ql - ,
1943 .Ss Built-in Commands
1944 This section lists the built-in commands.
1945 .Bl -tag -width indent
1950 The commands in the specified file are read and executed by the shell.
1964 If it is not found in the
1966 it is sought in the current working directory.
1968 A built-in equivalent of
1984 built-in command prints the names and values of all defined aliases
1988 suitable for re-input to the shell.
1998 This command is documented in
2002 .Sx Flow-Control Constructs
2005 Execute the specified built-in command,
2008 with the same name as a built-in command.
2013 to the directory specified in the
2018 to the directory specified in the
2030 then the directories listed in the
2084 built-in command.
2090 ignoring shell functions in the search.
2109 For ordinary commands the output is the path name; for shell built-in
2135 .Sx Flow-Control Constructs
2138 Print a space-separated list of the arguments to the standard output
2140 .Bl -tag -width indent
2144 Process C-style backslash escape sequences.
2148 .Bl -tag -width indent
2154 Suppress the trailing newline (this has the side-effect of truncating the
2177 is not enclosed in quotes then the backslash itself must be escaped
2180 .Bd -literal -offset indent
2181 $ echo -e "a\evb"
2184 $ echo -e a\e\evb
2187 $ echo -e "a\e\eb"
2189 $ echo -e a\e\e\e\eb
2201 Then re-parse and execute the command.
2207 (which must be a real program, not a shell built-in command or function).
2230 appear in the environment of subsequent commands.
2231 The only way to un-export a variable is to
2247 lines, suitable for re-input to the shell.
2249 A null command that returns a non-zero (false) exit value.
2255 built-in command lists, or edits and re-executes,
2257 .Bl -tag -width indent
2268 The value in the
2286 The commands are written in the
2307 Re-execute the command without invoking an editor.
2320 .Bl -tag -width indent
2332 For example, \-1 is the immediately previous command.
2346 .Bl -tag -width ".Va HISTSIZE"
2357 Parse command-line options and arguments.
2376 .Bl -offset indent
2432 command to delete all the entries in the hash table except for functions.
2434 Print the process IDs of the processes in the specified
2457 A built-in equivalent of
2465 A built-in equivalent of
2469 The built-in command may
2471 built-in command remembers what the current directory
2477 the built-in version of
2501 described in the section on
2504 the pieces are assigned to the variables in order.
2506 pieces (along with the characters in
2522 character will be treated as though it were not in
2572 option is specified, the read-only variables are printed as
2574 lines, suitable for re-input to the shell.
2580 .Oc Op Fl - Ar arg ...
2584 .Bl -item
2589 either in short form or using the long
2592 it sets or clears the specified options as described in the section called
2596 .Dq Fl -
2602 .Dq Fl -
2608 .Dq Fl -
2613 .Pq Ql -
2627 command is intended to be used in functions that
2654 A built-in equivalent of
2669 In addition, the pseudo-signal
2677 .Pq Ql - ;
2740 is not acceptable in this mode.
2745 .Bl -tag -width indent
2747 The maximum size of socket buffer usage, in bytes.
2749 The maximal size of core dump files, in 512-byte blocks.
2754 The maximal size of the data segment of a process, in kilobytes.
2756 The maximal size of a file, in 512-byte blocks.
2763 The maximal size of memory that can be locked by a process, in
2766 The maximal resident set size of a process, in kilobytes.
2770 The maximal number of process-shared locks
2775 The maximal number of pseudo-terminals for this user ID.
2777 The maximal size of the stack segment, in kilobytes.
2779 The maximal amount of CPU time to be used by each process, in seconds.
2783 The maximal virtual size of a process, in kilobytes.
2819 to complete and return the exit status of the last process in the
2837 .Sx Built-in Commands )
2839 .Nm vi Ns -mode
2842 to a subset of those described in the
2846 .Dq Li "set -o vi"
2848 .Dq Li "set -V" )
2850 .Nm vi Ns -mode
2857 .Nm vi Ns -mode
2864 while in command mode will pass the line to the shell.
2867 .Dq Li "set -o emacs"
2869 .Dq Li "set -E" )
2871 .Nm emacs Ns -style
2876 .Bl -tag -width ".Ev LANGXXXXXX"
2882 and is used in a limited manner by the shell itself.
2893 This is inherited by children of the shell, and is used in the history
2902 .Bl -tag -width "/etc/suid_profileXX" -compact
2918 cause the shell to exit with a non-zero exit status.
2946 command, the Thompson shell, appeared in
2948 It was superseded in
2955 was rewritten in 1989 under the
2959 and first appeared in
2969 utility does not recognize multibyte characters other than UTF-8.