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

1 .\"-
8 .\" Redistribution and use in source and binary forms, with or without
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
66 .St -p1003.1
83 a macro facility that provides a variety of features in
84 addition to data storage, along with built-in history and line
88 language is common to both interactive and non-interactive
108 .Pq Ql - ,
111 when the user first logs in.
121 is set on entry to a shell, or is set in the
126 at login time in the
133 variable to some file by placing the following line in the file
142 The first non-option argument specified on the command line
158 closes a well-known, and sometimes easily exploitable security
181 built-in command
182 (described later in the section called
183 .Sx Built-in Commands ) .
185 .Pq Ql -
191 .Dq Li --
193 .Ql -
202 .Bl -tag -width indent
213 Enable the built-in
220 Exit immediately if any untested command fails in non-interactive mode.
242 because it tends to behave in unexpected ways,
243 particularly in larger scripts.
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,
1079 .Bd -literal -offset indent
1085 .Bd -literal -offset indent
1089 The first form executes the commands in a subshell environment.
1091 .Bl -enum
1124 If job control is enabled in an interactive shell,
1125 commands grouped in parentheses can be suspended and continued as a unit.
1128 two open parentheses in sequence should be separated by whitespace.
1134 .Bd -literal -offset indent
1135 { echo -n "hello"; echo " world"; } > greeting
1166 command is implemented as a built-in command.
1168 unless the command is not in a function or a variable name is invalid.
1172 with the same name in the surrounding scope, if there is
1194 .Ql - .
1196 .Ql -
1218 command is implemented as a special built-in command.
1249 built-in commands that have this form.
1261 built-in command can also be used to set or reset them.
1265 They are shown in the following list, exactly as they would appear in input
1266 typed by the user or in the source of a shell script.
1267 .Bl -hang
1271 the expansion occurs within a double-quoted string
1282 the expansion occurs within double-quotes, each positional
1289 is double-quoted.
1303 .Bd -literal -offset indent
1310 .It Li $-
1311 (hyphen) Expands to the current option flags (the single-letter
1315 built-in command, or implicitly
1327 pipeline, the process ID is that of the last command in the
1332 built-in command reports completion of the process.
1344 .Bl -tag -width ".Va HISTSIZE"
1348 built-in.
1352 built-in.
1358 built-in.
1372 used in tilde expansion and as a default directory for the
1374 built-in.
1390 The current line number in the script or function.
1417 unless this variable is in the environment.
1424 unless you are the superuser, in which case it defaults to
1429 .Bl -tag -width indent
1431 The current time in
1441 This system's fully-qualified hostname (FQDN).
1459 Start of a sequence of non-printing characters (used, for example,
1462 End of a sequence of non-printing characters.
1465 The following special and non-printing characters are supported
1466 within the sequence of non-printing characters:
1467 .Bl -tag -width indent
1505 within double-quotes,
1509 .Bl -enum
1521 option is in effect).
1540 username is missing (as in
1556 escaped by a backslash or within a single-quoted or double-quoted
1557 string, and characters in
1559 expansions, are not examined in determining the matching
1563 .Ql - ,
1567 occur within a double-quoted string,
1569 (via double-quotes inside the expansion);
1571 within such parts are also not examined in determining the matching
1582 The parameter name or symbol can be enclosed in braces, which are
1586 If a parameter expansion occurs inside double-quotes:
1587 .Bl -enum
1599 .Bl -tag -width indent
1600 .It Li ${ Ns Ar parameter Ns Li :- Ns Ar word Ns Li }
1626 assigned in this way.
1653 In the parameter expansions shown previously, use of the colon in the
1654 format results in a test for a parameter that is unset or null; omission
1655 of the colon results in a test for a parameter that is only unset.
1660 (unquoted, double-quoted or here-document)
1664 .Bl -tag -width indent
1667 The length in characters of
1684 Enclosing the full parameter expansion string in double-quotes does not
1687 .Bl -tag -width indent
1694 parameter expansion then results in
1704 parameter expansion then results in
1714 parameter expansion then results in
1724 parameter expansion then results in
1730 Command substitution allows the output of a command to be substituted in
1749 and the quoting that is in effect.
1750 The command is executed in a subshell environment,
1751 except that the built-in commands
1760 if they are the only command in a command substitution.
1780 is treated as if it were in double-quotes, except
1781 that a double-quote inside the expression is not treated specially.
1783 shell expands all tokens in the
1792 .Bl -tag -width "Variables" -offset indent
1806 .Li "! ~ + -"
1808 .Li "* / % + - << >> < <= > >= == != & ^ | && ||"\&
1810 .Li "= += -= *= /= %= <<= >>= &= ^= |="
1815 The result of the expression is substituted in decimal.
1820 expansions and substitutions that did not occur in double-quotes for
1823 Characters in
1832 are treated differently from other characters in
1835 Whitespace in
1840 .Bl -enum
1842 a non-whitespace character in
1844 with any whitespace in
1848 one or more whitespace characters in
1852 If a word ends with a non-whitespace character in
1885 and meta-characters.
1886 The meta-characters are
1893 or back quotes are not double-quoted, the value of the
1895 characters and they are turned into meta-characters.
1916 A locale-dependent range of characters may be specified using a minus sign.
1931 has the same effect but is non-standard.
1942 .Ql - ,
1944 .Ss Built-in Commands
1945 This section lists the built-in commands.
1946 .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"
2400 command to delete all the entries in the hash table except for functions.
2402 Print the process IDs of the processes in the specified
2425 A built-in equivalent of
2433 A built-in equivalent of
2437 The built-in command may
2439 built-in command remembers what the current directory
2445 the built-in version of
2469 described in the section on
2472 the pieces are assigned to the variables in order.
2474 pieces (along with the characters in
2490 character will be treated as though it were not in
2540 option is specified, the read-only variables are printed as
2542 lines, suitable for re-input to the shell.
2548 .Oc Op Fl - Ar arg ...
2552 .Bl -item
2557 either in short form or using the long
2560 it sets or clears the specified options as described in the section called
2564 .Dq Fl -
2570 .Dq Fl -
2576 .Dq Fl -
2581 .Pq Ql -
2595 command is intended to be used in functions that
2622 A built-in equivalent of
2637 In addition, the pseudo-signal
2645 .Pq Ql - ;
2708 is not acceptable in this mode.
2713 .Bl -tag -width indent
2715 The maximum size of socket buffer usage, in bytes.
2717 The maximal size of core dump files, in 512-byte blocks.
2722 The maximal size of the data segment of a process, in kilobytes.
2724 The maximal size of a file, in 512-byte blocks.
2731 The maximal size of memory that can be locked by a process, in
2734 The maximal resident set size of a process, in kilobytes.
2738 The maximal number of process-shared locks
2743 The maximal number of pseudo-terminals for this user ID.
2745 The maximal size of the stack segment, in kilobytes.
2747 The maximal amount of CPU time to be used by each process, in seconds.
2751 The maximal virtual size of a process, in kilobytes.
2787 to complete and return the exit status of the last process in the
2805 .Sx Built-in Commands )
2807 .Nm vi Ns -mode
2810 to a subset of those described in the
2814 .Dq Li "set -o vi"
2816 .Dq Li "set -V" )
2818 .Nm vi Ns -mode
2825 .Nm vi Ns -mode
2832 while in command mode will pass the line to the shell.
2835 .Dq Li "set -o emacs"
2837 .Dq Li "set -E" )
2839 .Nm emacs Ns -style
2844 .Bl -tag -width ".Ev LANGXXXXXX"
2850 and is used in a limited manner by the shell itself.
2861 This is inherited by children of the shell, and is used in the history
2870 .Bl -tag -width "/etc/suid_profileXX" -compact
2886 cause the shell to exit with a non-zero exit status.
2914 command, the Thompson shell, appeared in
2916 It was superseded in
2923 was rewritten in 1989 under the
2935 utility does not recognize multibyte characters other than UTF-8.