<http://schema.org/articleBody>
"&amp;lt;h3&amp;gt;NAME&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;sh - command interpreter (&amp;lt;a href=&amp;quot;https://www.lifewire.com/example-uses-of-the-linux-curl-command-4084144&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;1&amp;quot;&amp;gt;shell&amp;lt;/a&amp;gt;)\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;SYNOPSIS&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;sh&amp;lt;/strong&amp;gt;\u00A0[-&amp;lt;strong&amp;gt;/&amp;amp;#43;aCefnuvxIimqsVEbc&amp;lt;/strong&amp;gt;\u00A0] [-&amp;lt;strong&amp;gt;o\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;longname&amp;lt;/em&amp;gt;\u00A0] -words [&amp;lt;em&amp;gt;target ...&amp;lt;/em&amp;gt;\u00A0]\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;DESCRIPTION&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Sh is the standard command interpreter for the system. The current version of\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/pass-arguments-to-bash-script-2200571&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;sh&amp;lt;/strong&amp;gt;&amp;lt;/a&amp;gt;\u00A0is in the process of being changed to conform with the\u00A0&amp;lt;strong&amp;gt;POSIX&amp;lt;/strong&amp;gt;\u00A01003.2 and 1003.2a specifications for the shell. This version has many features which make it appear similar in some respects to the Korn shell, but it is not a Korn shell clone (see ksh(1)). Only features designated by\u00A0&amp;lt;strong&amp;gt;POSIX&amp;lt;/strong&amp;gt;\u00A0plus a few Berkeley extensions, are being incorporated into this shell. We expect\u00A0&amp;lt;strong&amp;gt;POSIX&amp;lt;/strong&amp;gt;\u00A0conformance by the time 4.4 BSD is released. This man page is not intended to be a tutorial or a complete specification of the shell.\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Overview&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The &amp;lt;a href=&amp;quot;https://www.lifewire.com/uses-command-more-2201073&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;3&amp;quot;&amp;gt;shell is a command&amp;lt;/a&amp;gt; that reads lines from either a file or the terminal, interprets them, and generally executes other commands. It is the program that is running when a user logs into the system (although a user can select a different shell with the\u00A0chsh(1) command). The shell implements a language that has flow control constructs, a macro facility that provides a variety of features in addition to data storage, along with built in history and line editing capabilities. It incorporates many features to aid interactive use and has the advantage that the interpretative language is common to both interactive and non-interactive use (shell scripts). That is, commands can be typed directly to the running shell or can be put into a file and the file can be executed directly by the shell.\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Invocation&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;If no args are present and if the standard input of the shell is connected to a terminal (or if the -&amp;lt;strong&amp;gt;i&amp;lt;/strong&amp;gt;flag is set), and the -&amp;lt;strong&amp;gt;c&amp;lt;/strong&amp;gt;\u00A0option is not present, the shell is considered an interactive &amp;lt;a href=&amp;quot;https://www.lifewire.com/why-would-you-use-shivi-variable-2196747&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;4&amp;quot;&amp;gt;shell&amp;lt;/a&amp;gt;. An interactive shell generally prompts before each command and handles programming and &amp;lt;a href=&amp;quot;https://www.lifewire.com/traceroute-linux-command-4092586&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;5&amp;quot;&amp;gt;command&amp;lt;/a&amp;gt; errors differently (as described below). When first starting, the shell inspects argument 0, and if it begins with a dash &amp;amp;#96;-&amp;amp;#39; the shell is also considered a login shell. This is normally done automatically by the system when the user first logs in. A login shell first reads commands from the files /etc/profile and .profile if they exist. If the environment variable\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0is set on entry to a shell, or is set in the .profile of a login shell, the shell next reads commands from the file named in\u00A0&amp;lt;strong&amp;gt;ENV\u00A0&amp;lt;/strong&amp;gt;Therefore, a user should place commands that are to be executed only at login time in the .profile file, and commands that are executed for every shell inside the\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0file. To set the\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0variable to some file, place the following line in your .profile of your home directory&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;ENV&amp;amp;#61;$HOME/.shinit; export ENV&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;substituting for &amp;amp;#96;&amp;amp;#96;.shinit&amp;amp;#39;&amp;amp;#39; any &amp;lt;a href=&amp;quot;https://www.lifewire.com/view-end-of-line-tail-command-4028901&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;6&amp;quot;&amp;gt;filename&amp;lt;/a&amp;gt; you wish. Since the\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0file is read for every invocation of the shell, including shell scripts and non-interactive shells, the following paradigm is useful for restricting commands in the\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0file to interactive invocations. Place commands within the &amp;amp;#96;&amp;amp;#96;case&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;&amp;lt;a href=&amp;quot;https://www.lifewire.com/write-if-statements-in-bash-script-2200578&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;7&amp;quot;&amp;gt;esac&amp;lt;/a&amp;gt;&amp;amp;#39;&amp;amp;#39; below (these commands are described later):&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;case $- in *i*)&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;# &amp;lt;a href=&amp;quot;https://www.lifewire.com/linux-command-complete-4092535&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;8&amp;quot;&amp;gt;commands&amp;lt;/a&amp;gt; for interactive use only&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;esac&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If command line arguments besides the options have been specified, then the shell treats the first argument as the name of a file from which to read commands (a shell script), and the remaining arguments are set as the positional parameters of the shell ($1, $2, etc). Otherwise, the shell reads commands from its standard input.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Argument List Processing&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;All of the single letter options have a corresponding name that can be used as an argument to the -&amp;lt;strong&amp;gt;o&amp;lt;/strong&amp;gt;\u00A0option. The set -&amp;lt;strong&amp;gt;o&amp;lt;/strong&amp;gt;\u00A0name is provided next to the single letter option in the description below. Specifying a dash &amp;amp;#96;&amp;amp;#96;-&amp;amp;#39;&amp;amp;#39; turns the option on, while using a plus &amp;amp;#96;&amp;amp;#96;&amp;amp;#43;&amp;amp;#39;&amp;amp;#39; disables the option. The following options can be set from the command line or with the\u00A0set(1) builtin (described later).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-a\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;allexport&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Export all variables assigned to. (UNIMPLEMENTED for 4.4alpha)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-c&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Read commands from the command line. No commands will be read from the standard input.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-C\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;noclobber&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Don&amp;amp;#39;t overwrite existing files with &amp;amp;#96;&amp;amp;#96;&amp;amp;gt;&amp;amp;#39;&amp;amp;#39; (UNIMPLEMENTED for 4.4alpha)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-e\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;errexit&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explicitly tested if the command is used to control an\u00A0&amp;lt;strong&amp;gt;if&amp;lt;/strong&amp;gt;\u00A0&amp;lt;strong&amp;gt;elif&amp;lt;/strong&amp;gt;&amp;lt;strong&amp;gt;while&amp;lt;/strong&amp;gt;\u00A0or\u00A0&amp;lt;strong&amp;gt;until&amp;lt;/strong&amp;gt;\u00A0or if the command is the left hand operand of an &amp;amp;#96;&amp;amp;#96;&amp;amp;amp;&amp;amp;amp;&amp;amp;#39;&amp;amp;#39; or &amp;amp;#96;&amp;amp;#96;||&amp;amp;#39;&amp;amp;#39; operator.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-f\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;noglob&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Disable &amp;lt;a href=&amp;quot;https://www.lifewire.com/how-to-view-and-remove-safari-plug-ins-2260895&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;9&amp;quot;&amp;gt;pathname&amp;lt;/a&amp;gt; expansion.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-n\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;noexec&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If not interactive, read commands but do not execute them. This is useful for checking the syntax of shell scripts.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-u\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;nounset&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Write a message to standard error when attempting to expand a variable that is not set, and if the shell is not interactive, exit immediately. (UNIMPLEMENTED for 4.4alpha)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-v\u00A0&amp;lt;/strong&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/definition-of-verbose-output-2198791&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;10&amp;quot;&amp;gt;&amp;lt;em&amp;gt;verbose&amp;lt;/em&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The shell writes its input to standard error as it is read. Useful for debugging.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-x\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;xtrace&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Write each command to &amp;lt;a href=&amp;quot;https://www.lifewire.com/linux-command-rsh-4092516&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;11&amp;quot;&amp;gt;standard error&amp;lt;/a&amp;gt; (preceded by a &amp;amp;#96;&amp;amp;#43;\u00A0&amp;amp;#39; before it is executed. Useful for debugging.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-q\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;quietprofile&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If the -&amp;lt;strong&amp;gt;v&amp;lt;/strong&amp;gt;\u00A0or -&amp;lt;strong&amp;gt;x&amp;lt;/strong&amp;gt;\u00A0options have been set, do not apply them when reading initialization files, these being /etc/profile .profile and the file specified by the\u00A0&amp;lt;strong&amp;gt;ENV&amp;lt;/strong&amp;gt;\u00A0environment variable.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-I\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;ignoreeof&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Ignore EOF&amp;amp;#39;s from input when interactive.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-i\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;interactive&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Force the shell to behave interactively.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-m\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;monitor&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Turn on job control (set automatically when interactive).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-s\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;stdin&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Read commands from &amp;lt;a href=&amp;quot;https://www.lifewire.com/ping-command-2618099&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;12&amp;quot;&amp;gt;standard input&amp;lt;/a&amp;gt; (set automatically if no file arguments are present). This option has no effect when set after the shell has already started running (i.e. with\u00A0set(1)).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-V\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;vi&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Enable the built-in\u00A0vi(1) command line editor (disables -&amp;lt;strong&amp;gt;E&amp;lt;/strong&amp;gt;\u00A0if it has been set).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-E\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;emacs&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Enable the built-in\u00A0emacs(1) command line editor (disables -&amp;lt;strong&amp;gt;V&amp;lt;/strong&amp;gt;\u00A0if it has been set).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-b\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;notify&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Enable asynchronous notification of background job completion. (UNIMPLEMENTED for 4.4alpha)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Lexical Structure&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The shell reads input in terms of lines from a file and breaks it up into words at whitespace (blanks and tabs), and at certain sequences of characters that are special to the shell called &amp;amp;#96;&amp;amp;#96;operators&amp;amp;#39;&amp;amp;#39; There are two types of operators: control operators and redirection operators (their meaning is discussed later). Following is a list of operators:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;#34;Control operators:&amp;amp;#34;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;amp;amp; &amp;amp;amp;&amp;amp;amp; ( ) ; ;; | || &amp;amp;lt;newline&amp;amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;#34;Redirection operator:&amp;amp;#34;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;amp;lt; &amp;amp;gt; &amp;amp;gt;| &amp;amp;lt;&amp;amp;lt; &amp;amp;gt;&amp;amp;gt; &amp;amp;lt;&amp;amp;amp; &amp;amp;gt;&amp;amp;amp; &amp;amp;lt;&amp;amp;lt;- &amp;amp;lt;&amp;amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Quoting&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Quoting is used to remove the special meaning of certain characters or words to the shell, such as operators, whitespace, or keywords. There are three types of quoting: matched single quotes, matched double quotes, and backslash.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Backslash&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A backslash preserves the literal meaning of the following character, with the exception of Aq newline . A backslash preceding a Aq newline is treated as a line continuation.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Single Quotes&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Enclosing characters in single quotes preserves the literal meaning of all the characters (except single quotes, making it impossible to put single-quotes in a single-quoted string).\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Double Quotes&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Enclosing characters within double quotes preserves the literal meaning of all characters except dollarsign ($) backquote (&amp;amp;#96;) and backslash (\\) The backslash inside double quotes is historically weird, and serves to quote only the following characters:&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;$ &amp;amp;#96; \\ &amp;amp;lt;newline&amp;amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;Otherwise it remains literal.\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Reserved Words&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and after a control operator. The following are reserved words:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;! Ta\u00A0&amp;lt;/strong&amp;gt;elif Ta fi Ta while Ta case&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;else Ta\u00A0&amp;lt;/strong&amp;gt;for Ta then Ta { Ta }&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;do Ta\u00A0&amp;lt;/strong&amp;gt;done Ta until Ta if Ta esac&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Their meaning is discussed later.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Aliases&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;An alias is a name and corresponding value set using the\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/linus-unix-command-expect-2201096&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;13&amp;quot;&amp;gt;alias&amp;lt;/a&amp;gt;(1) builtin command. Whenever a reserved word may occur (see above), and after checking for reserved words, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called &amp;amp;#96;&amp;amp;#96;lf&amp;amp;#39;&amp;amp;#39; with the value &amp;amp;#96;&amp;amp;#96;ls -F&amp;amp;#39;&amp;amp;#39; then the input:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;lf foobar &amp;amp;lt;return&amp;amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;would become&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;ls -F foobar &amp;amp;lt;return&amp;amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;Aliases provide a convenient way for naive users to create shorthands for commands without having to learn how to create functions with arguments. They can also be used to create lexically obscure code. This use is discouraged.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Commands&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The shell interprets the words it reads according to a language, the specification of which is outside the scope of this man page (refer to the BNF in the\u00A0&amp;lt;strong&amp;gt;POSIX&amp;lt;/strong&amp;gt;\u00A01003.2 document). Essentially though, a line is read and if the first word of the line (or after a control operator) is not a reserved word, then the shell has recognized a simple command. Otherwise, a complex command or some other special construct may have been recognized.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Simple Commands&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;If a simple command has been recognized, the shell performs the following actions:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Leading words of the form &amp;amp;#96;&amp;amp;#96;name&amp;amp;#61;value&amp;amp;#39;&amp;amp;#39; are stripped off and assigned to the environment of the simple command. Redirection operators and their arguments (as described below) are stripped off and saved for processing.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;The remaining words are expanded as described in the section called &amp;amp;#96;&amp;amp;#96;Expansions&amp;amp;#39;&amp;amp;#39; and the first remaining word is considered the command name and the command is located. The remaining words are considered the arguments of the command. If no command name resulted, then the &amp;amp;#96;&amp;amp;#96;name&amp;amp;#61;value&amp;amp;#39;&amp;amp;#39; variable assignments recognized in item 1 affect the current shell.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Redirections are performed as described in the next section.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Redirections&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Redirections are used to change where a command reads its input or sends its output. In general, redirections open, close, or duplicate an existing reference to a file. The overall format used for redirection is:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;[n]\u00A0&amp;lt;em&amp;gt;redir-op file&amp;lt;/em&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;where\u00A0&amp;lt;em&amp;gt;redir-op&amp;lt;/em&amp;gt;\u00A0is one of the redirection operators mentioned previously. Following is a list of the possible redirections. The Bq n is an optional number, as in &amp;amp;#96;3&amp;amp;#39; (not &amp;amp;#96;Bq 3 &amp;amp;#39; that refers to a file descriptor.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;gt; file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Redirect standard output (or n) to file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;gt;| file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Same, but override the -&amp;lt;strong&amp;gt;C&amp;lt;/strong&amp;gt;\u00A0option.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;gt;&amp;amp;gt; file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Append standard output (or n) to file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;lt; file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Redirect standard input (or n) from file.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n1] &amp;amp;lt;&amp;amp;amp; n2&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Duplicate standard input (or n1) from file descriptor n2.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;lt;&amp;amp;amp;-&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Close standard input (or n).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n1] &amp;amp;gt;&amp;amp;amp; n2&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Duplicate standard output (or n1) from n2.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;gt;&amp;amp;amp;-&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Close standard output (or n).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n] &amp;amp;lt;&amp;amp;gt; file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Open file for reading and writing on standard input (or n).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The following redirection is often called a &amp;amp;#96;&amp;amp;#96;here-document&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[n]&amp;amp;lt;&amp;amp;lt; delimiter&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;here-doc-text...&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;delimiter&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;All the text on successive lines up to the delimiter is saved away and made available to the command on standard input, or file descriptor n if it is specified. If the delimiter as specified on the initial line is quoted, then the here-doc-text is treated literally, otherwise the text is subjected to parameter expansion, command substitution, and arithmetic expansion (as described in the section on &amp;amp;#96;&amp;amp;#96;Expansions )&amp;amp;#39;&amp;amp;#39; If the operator is &amp;amp;#96;&amp;amp;#96;&amp;amp;lt;&amp;amp;lt;-&amp;amp;#39;&amp;amp;#39; instead of &amp;amp;#96;&amp;amp;#96;&amp;amp;lt;&amp;amp;lt;&amp;amp;#39;&amp;amp;#39; then leading tabs in the here-doc-text are stripped.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Search and Execution&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;There are three types of commands: shell functions, builtin commands, and normal programs -- and the command is searched for (by name) in that order. They each are executed in a different way.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;When a shell function is executed, all of the shell positional parameters (except $0, which remains unchanged) are set to the arguments of the shell function. The variables which are explicitly placed in the environment of the command (by placing assignments to them before the function name) are made local to the function and are set to the values given. Then the command given in the function definition is executed. The positional parameters are restored to their original values when the command completes. This all occurs within the current shell.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Shell builtins are executed internally to the shell, without spawning a new process.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Otherwise, if the command name doesn&amp;amp;#39;t match a function or builtin, the command is searched for as a normal program in the filesystem (as described in the next section). When a normal program is executed, the shell runs the program, passing the arguments and the environment to the program. If the program is not a normal executable file (i.e., if it does not begin with the &amp;amp;#34;magic number&amp;amp;#34; whose\u00A0&amp;lt;strong&amp;gt;ASCII&amp;lt;/strong&amp;gt;\u00A0representation is &amp;amp;#34;#!&amp;amp;#34;, so\u00A0execve(2) returns Er ENOEXEC then) the shell will interpret the program in a subshell. The child shell will reinitialize itself in this case, so that the effect will be as if a new shell had been invoked to handle the ad-hoc shell script, except that the location of hashed commands located in the parent shell will be remembered by the child.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Note that previous versions of this document and the source code itself misleadingly and sporadically refer to a shell script without a magic number as a &amp;amp;#34;shell procedure&amp;amp;#34;.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Path Search&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;When locating a command, the shell first looks to see if it has a shell function by that name. Then it looks for a builtin command by that name. If a builtin command is not found, one of two things happen:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Command names containing a slash are simply executed without performing any searches.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;The shell searches each entry in\u00A0&amp;lt;strong&amp;gt;PATH&amp;lt;/strong&amp;gt;\u00A0in turn for the command. The value of the\u00A0&amp;lt;strong&amp;gt;PATH&amp;lt;/strong&amp;gt;variable should be a series of entries separated by colons. Each entry consists of a directory name. The current directory may be indicated implicitly by an empty directory name, or explicitly by a single period.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Command Exit Status&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Each command has an exit status that can influence the behavior of other shell commands. The paradigm is that a command exits with zero for normal or success, and non-zero for failure, error, or a false indication. The man page for each command should indicate the various exit codes and what they mean. Additionally, the builtin commands return exit codes, as does an executed shell function.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Complex Commands&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Complex commands are combinations of simple commands with control operators or reserved words, together creating a larger complex command. More generally, a command is one of the following:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;simple command&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;pipeline&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;list or compound-list&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;compound command&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;function definition&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Unless otherwise stated, the exit status of a command is that of the last simple command executed by the command.&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Pipelines&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A pipeline is a sequence of one or more commands separated by the control operator |. The standard output of all but the last command is connected to the standard input of the next command. The standard output of the last command is inherited from the shell, as usual.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The format for a pipeline is:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;[!] command1 [ | command2 ...]&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The standard output of command1 is connected to the standard input of command2. The standard input, standard output, or both of a command is considered to be assigned by the pipeline before any redirection specified by redirection operators that are part of the command.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If the pipeline is not in the background (discussed later), the shell waits for all commands to complete.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If the reserved word ! does not precede the pipeline, the exit status is the exit status of the last command specified in the pipeline. Otherwise, the exit status is the logical NOT of the exit status of the last command. That is, if the last command returns zero, the exit status is 1; if the last command returns greater than zero, the exit status is zero.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Because pipeline assignment of standard input or standard output or both takes place before redirection, it can be modified by redirection. For example:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;$ command1 2&amp;amp;gt;&amp;amp;amp;1 | command2&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;sends both the standard output and standard error of command1 to the standard input of command2.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A ; or &amp;amp;lt;newline&amp;amp;gt; terminator causes the preceding AND-OR-list (described next) to be executed sequentially; a &amp;amp;amp; causes asynchronous execution of the preceding AND-OR-list.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Note that unlike some other shells, each process in the pipeline is a child of the invoking shell (unless it is a shell builtin, in which case it executes in the current shell -- but any effect it has on the environment is wiped).\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Background Commands --&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;If a command is terminated by the control operator ampersand (&amp;amp;amp;), the shell executes the command asynchronously -- that is, the shell does not wait for the command to finish before executing the next command.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The format for running a command in background is:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;command1 &amp;amp;amp; [command2 &amp;amp;amp; ...]&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;If the shell is not interactive, the standard input of an asynchronous command is set to /dev/null\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Lists -- Generally Speaking&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A list is a sequence of zero or more commands separated by newlines, semicolons, or ampersands, and optionally terminated by one of these three characters. The commands in a list are executed in the order they are written. If command is followed by an ampersand, the shell starts the command and immediately proceed onto the next command; otherwise it waits for the command to terminate before proceeding to the next one.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Short-Circuit List Operators&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;amp;#96;&amp;amp;#96;&amp;amp;amp;&amp;amp;amp;&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;||&amp;amp;#39;&amp;amp;#39; are AND-OR list operators. &amp;amp;#96;&amp;amp;#96;&amp;amp;amp;&amp;amp;amp;&amp;amp;#39;&amp;amp;#39; executes the first command, and then executes the second command iff the exit status of the first command is zero. &amp;amp;#96;&amp;amp;#96;||&amp;amp;#39;&amp;amp;#39; is similar, but executes the second command iff the exit status of the first command is nonzero. &amp;amp;#96;&amp;amp;#96;&amp;amp;amp;&amp;amp;amp;&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;||&amp;amp;#39;&amp;amp;#39; both have the same priority.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Flow-Control Constructs -- if, while, for, case&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The syntax of the if command is&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\nif list\nthen list\n[ elif list\nthen list ] ...\n[ else list ]\nfi\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The syntax of the while command is&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\nwhile list\ndo list\ndone\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The two lists are executed repeatedly while the exit status of the first list is zero. The until command is similar, but has the word until in place of while, which causes it to repeat until the exit status of the first list is zero.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The syntax of the for command is&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\nfor variable in word...\ndo list\ndone\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The words are expanded, and then the list is executed repeatedly with the variable set to each word in turn. do and done may be replaced with &amp;amp;#96;&amp;amp;#96;{&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;}&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The syntax of the break and continue command is&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\nbreak [ num ]\ncontinue [ num ]\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;Break terminates the num innermost for or while loops. Continue continues with the next iteration of the innermost loop. These are implemented as builtin commands.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The syntax of the case command is&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\ncase word in\npattern) list ;;\n...\nesac\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The pattern can actually be one or more patterns (see Shell Patterns described later), separated by &amp;amp;#96;&amp;amp;#96;&amp;amp;#39;&amp;amp;#39; characters.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Grouping Commands Together&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Commands may be grouped by writing either&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;(list)&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;or&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;{ list;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The first of these executes the commands in a subshell. Builtin commands grouped into a (list) will not affect the current shell. The second form does not fork another shell so is slightly more efficient. Grouping commands together this way allows you to redirect their output as though they were one program:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\n{ printf hello ; printf world\\n&amp;amp;#34; ; } &amp;amp;gt; greeting\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Functions&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The syntax of a function definition is&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;name ( ) command&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;A function definition is an executable statement; when executed it installs a function named name and returns an exit status of zero. The command is normally a list enclosed between &amp;amp;#96;&amp;amp;#96;{&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;}&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Variables may be declared to be local to a function by using a local command. This should appear as the first statement of a function, and the syntax is&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;local [ variable | - ] ...&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;Local is implemented as a builtin command.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;When a variable is made local, it inherits the initial value and exported and readonly flags from the variable with the same name in the surrounding scope, if there is one. Otherwise, the variable is initially unset. The shell uses dynamic scoping, so that if you make the variable x local to function f, which then calls function g, references to the variable x made inside g will refer to the variable x declared inside f, not to the global variable named x.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The only special parameter than can be made local is &amp;amp;#96;&amp;amp;#96;-&amp;amp;#39;&amp;amp;#39; Making &amp;amp;#96;&amp;amp;#96;-&amp;amp;#39;&amp;amp;#39; local any shell options that are changed via the set command inside the function to be restored to their original values when the function returns.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The syntax of the return command is&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;return [ exitstatus&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;It terminates the currently executing function. Return is implemented as a builtin command.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Variables and Parameters&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The shell maintains a set of parameters. A parameter denoted by a name is called a variable. When starting up, the shell turns all the environment variables into shell variables. New variables can be set using the form&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;name&amp;amp;#61;value&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;Variables set by the user must have a name consisting solely of alphabetics, numerics, and underscores - the first of which must not be numeric. A parameter can also be denoted by a number or a special character as explained below.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Positional Parameters&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A positional parameter is a parameter denoted by a number (n &amp;amp;gt; 0). The shell sets these initially to the values of its command line arguments that follow the name of the shell script. The\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/linus-unix-command-expect-2201096&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;14&amp;quot;&amp;gt;set&amp;lt;/a&amp;gt;(1) builtin can also be used to set or reset them.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Special Parameters&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A special parameter is a parameter denoted by one of the following special characters. The value of the parameter is listed next to its character.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;*&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the positional parameters, starting from one. When the expansion occurs within a double-quoted &amp;lt;a href=&amp;quot;https://www.lifewire.com/strings-linux-command-4093452&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;15&amp;quot;&amp;gt;string&amp;lt;/a&amp;gt; it expands to a single field with the value of each parameter separated by the first character of the\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0variable, or by a &amp;amp;lt;space&amp;amp;gt; if\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0is unset.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;#64;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the positional parameters, starting from one. When the expansion occurs within double-quotes, each positional parameter expands as a separate argument. If there are no positional parameters, the expansion of &amp;amp;#64; generates zero arguments, even when &amp;amp;#64; is double-quoted. What this basically means, for example, is if $1 is &amp;amp;#96;&amp;amp;#96;abc&amp;amp;#39;&amp;amp;#39; and $2 is &amp;amp;#96;&amp;amp;#96;def ghi&amp;amp;#39;&amp;amp;#39; then Qq $&amp;amp;#64; expands to the two arguments:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;abc \u00A0 def\u00A0ghi&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;#&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the number of positional parameters.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;?&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the exit status of the most recent pipeline.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;- (Hyphen.)&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the current option flags (the single-letter option names concatenated into a string) as specified on invocation, by the set builtin command, or implicitly by the shell.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;$&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the process ID of the invoked shell. A subshell retains the same value of $ as its parent.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;!&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the process ID of the most recent background command executed from the current shell. For a pipeline, the process ID is that of the last command in the pipeline.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;0 (Zero.)&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Expands to the name of the shell or shell script.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Word Expansions&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This clause describes the various expansions that are performed on words. Not all expansions are performed on every word, as explained later.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Tilde expansions, parameter expansions, command substitutions, arithmetic expansions, and quote removals that occur within a single word expand to a single field. It is only field splitting or pathname expansion that can create multiple fields from a single word. The single exception to this rule is the expansion of the special parameter &amp;amp;#64; within double-quotes, as was described above.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The order of word expansion is:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Tilde Expansion, Parameter Expansion, Command Substitution, Arithmetic Expansion (these all occur at the same time).&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Field Splitting is performed on fields generated by step (1) unless the\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0variable is null.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Pathname Expansion (unless set -&amp;lt;strong&amp;gt;f&amp;lt;/strong&amp;gt;\u00A0is in effect).&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Quote Removal.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The $ character is used to introduce parameter expansion, command substitution, or arithmetic evaluation.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Tilde Expansion (substituting a user&amp;amp;#39;s home directory)&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A word beginning with an unquoted tilde character (~) is subjected to tilde expansion. All the characters up to a slash (/) or the end of the word are treated as a username and are replaced with the user&amp;amp;#39;s home directory. If the username is missing (as in ~/foobar ) the tilde is replaced with the value of the\u00A0&amp;lt;em&amp;gt;HOME&amp;lt;/em&amp;gt;\u00A0variable (the current user&amp;amp;#39;s home directory).\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Parameter Expansion&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;The format for parameter expansion is as follows:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;${expression}&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;where expression consists of all characters until the matching &amp;amp;#96;&amp;amp;#96;}&amp;amp;#39;&amp;amp;#39; Any &amp;amp;#96;&amp;amp;#96;}&amp;amp;#39;&amp;amp;#39; escaped by a backslash or within a quoted string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching &amp;amp;#96;&amp;amp;#96;}&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The simplest form for parameter expansion is:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;${parameter}&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The value, if any, of parameter is substituted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The parameter name or symbol can be enclosed in braces, which are optional except for positional parameters with more than one digit or when parameter is followed by a character that could be interpreted as part of the name. If a parameter expansion occurs inside double-quotes:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Pathname expansion is not performed on the results of the expansion.&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Field splitting is not performed on the results of the expansion, with the exception of &amp;amp;#64;.&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;In addition, a parameter expansion can be modified by using one of the following formats.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter:-word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Use Default Values. If parameter is unset or null, the expansion of word is substituted; otherwise, the value of parameter is substituted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter:&amp;amp;#61;word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. In all cases, the final value of parameter is substituted. Only variables, not positional parameters or special parameters, can be assigned in this way.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter:?[word]}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Indicate Error if Null or Unset. If parameter is unset or null, the expansion of word (or a message indicating it is unset if word is omitted) is written to standard error and the shell exits with a nonzero exit status. Otherwise, the value of parameter is substituted. An interactive shell need not exit.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter:&amp;amp;#43;word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Use Alternative Value. If parameter is unset or null, null is substituted; otherwise, the expansion of word is substituted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;In the parameter expansions shown previously, use of the colon in the format results in a test for a parameter that is unset or null; omission of the colon results in a test for a parameter that is only unset.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${#parameter}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;String Length. The length in characters of the value of parameter.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The following four varieties of parameter expansion provide for substring processing. In each case, pattern matching notation (see Shell Patterns), rather than regular expression notation, is used to evaluate the patterns. If parameter is * or &amp;amp;#64;, the result of the expansion is unspecified. Enclosing the full parameter expansion string in double-quotes does not cause the following four varieties of pattern characters to be quoted, whereas quoting characters within the braces has this effect.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter%word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Remove Smallest Suffix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the smallest portion of the suffix matched by the pattern deleted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter%%word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Remove Largest Suffix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the largest portion of the suffix matched by the pattern deleted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter#word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Remove Smallest Prefix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the smallest portion of the prefix matched by the pattern deleted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;${parameter##word}&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Remove Largest Prefix Pattern. The word is expanded to produce a pattern. The parameter expansion then results in parameter, with the largest portion of the prefix matched by the pattern deleted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Command Substitution&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/write-awk-commands-and-scripts-2200573&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;16&amp;quot;&amp;gt;Command substitution&amp;lt;/a&amp;gt; allows the output of a command to be substituted in place of the command name itself. Command substitution occurs when the command is enclosed as follows:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;$(command)&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;or Po &amp;amp;#96;&amp;amp;#96;backquoted&amp;amp;#39;&amp;amp;#39; version Pc :&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;amp;#96;command&amp;amp;#96;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The shell expands the command substitution by executing command in a subshell environment and replacing the command substitution with the standard output of the command, removing sequences of one or more &amp;amp;lt;newline&amp;amp;gt;s at the end of the substitution. (Embedded &amp;amp;lt;newline&amp;amp;gt;s before the end of the output are not removed; however, during field splitting, they may be translated into &amp;amp;lt;space&amp;amp;gt;s, depending on the value of\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0and quoting that is in effect.)\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Arithmetic Expansion&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Arithmetic expansion provides a mechanism for evaluating an arithmetic expression and substituting its value. The format for arithmetic expansion is as follows:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;$((expression))&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;The expression is treated as if it were in double-quotes, except that a double-quote inside the expression is not treated specially. The shell expands all tokens in the expression for parameter expansion, command substitution, and quote removal.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Next, the shell treats this as an arithmetic expression and substitutes the value of the expression.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;White Space Splitting (Field Splitting)&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;After parameter expansion, command substitution, and arithmetic expansion the shell scans the results of expansions and substitutions that did not occur in double-quotes for field splitting and multiple fields can result.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The shell treats each character of the\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0as a delimiter and use the delimiters to split the results of parameter expansion and command substitution into fields.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Pathname Expansion (File Name Generation)&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;Unless the -&amp;lt;strong&amp;gt;f&amp;lt;/strong&amp;gt;\u00A0flag is set, file name generation is performed after word splitting is complete. Each word is viewed as a series of patterns, separated by slashes. The process of expansion replaces the word with the names of all existing files whose names can be formed by replacing each pattern with a string that matches the specified pattern. There are two restrictions on this: first, a pattern cannot match a string containing a slash, and second, a pattern cannot match a string starting with a period unless the first character of the pattern is a period. The next section describes the patterns used for both Pathname Expansion and the case(1) command.\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Shell Patterns&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;A pattern consists of normal characters, which match themselves, and meta-characters. The meta-characters are &amp;amp;#96;&amp;amp;#96;!&amp;amp;#39;&amp;amp;#39; &amp;amp;#96;&amp;amp;#96;*&amp;amp;#39;&amp;amp;#39; &amp;amp;#96;&amp;amp;#96;?&amp;amp;#39;&amp;amp;#39; and &amp;amp;#96;&amp;amp;#96;[&amp;amp;#39;&amp;amp;#39; These characters lose their special meanings if they are quoted. When command or variable substitution is performed and the dollar sign or back quotes are not double quoted, the value of the variable or the output of the command is scanned for these characters and they are turned into meta-characters.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;An asterisk (&amp;amp;#96;&amp;amp;#96;*&amp;amp;#39;&amp;amp;#39; ) matches any string of characters. A question mark matches any single character. A left bracket (&amp;amp;#96;&amp;amp;#96;[&amp;amp;#39;&amp;amp;#39; ) introduces a character class. The end of the character class is indicated by a (&amp;amp;#96;&amp;amp;#96;]&amp;amp;#39;&amp;amp;#39; ) if the &amp;amp;#96;&amp;amp;#96;]&amp;amp;#39;&amp;amp;#39; is missing then the &amp;amp;#96;&amp;amp;#96;[&amp;amp;#39;&amp;amp;#39; matches a &amp;amp;#96;&amp;amp;#96;[&amp;amp;#39;&amp;amp;#39; rather than introducing a character class. A character class matches any of the characters between the square brackets. A range of characters may be specified using a minus sign. The character class may be complemented by making an exclamation point the first character of the character class.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;To include a &amp;amp;#96;&amp;amp;#96;]&amp;amp;#39;&amp;amp;#39; in a character class, make it the first character listed (after the &amp;amp;#96;&amp;amp;#96;!&amp;amp;#39;&amp;amp;#39; if any). To include a minus sign, make it the first or last character listed\u00A0\u00A0&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;Builtins&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;This section lists the builtin commands which are builtin because they need to perform some operation that can&amp;amp;#39;t be performed by a separate process. In addition to these, there are several other commands that may be builtin for efficiency (e.g.\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/output-text-to-the-screen-linux-echo-command-3572040&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;17&amp;quot;&amp;gt;echo&amp;lt;/a&amp;gt;\u00A01).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;:&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A null command that returns a 0 (true) exit value.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;. file&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The commands in the specified file are read and executed by the shell.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;alias\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;name\u00A0&amp;lt;/em&amp;gt;[&amp;lt;em&amp;gt;&amp;amp;#61;string ...&amp;lt;/em&amp;gt;\u00A0] ]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If\u00A0&amp;lt;em&amp;gt;name&amp;amp;#61;string&amp;lt;/em&amp;gt;\u00A0is specified, the shell defines the alias\u00A0&amp;lt;em&amp;gt;name&amp;lt;/em&amp;gt;\u00A0with value\u00A0&amp;lt;em&amp;gt;string&amp;lt;/em&amp;gt;\u00A0If just\u00A0&amp;lt;em&amp;gt;name&amp;lt;/em&amp;gt;\u00A0is specified, the value of the alias\u00A0&amp;lt;em&amp;gt;name&amp;lt;/em&amp;gt;\u00A0is printed. With no arguments, the\u00A0&amp;lt;strong&amp;gt;alias&amp;lt;/strong&amp;gt;\u00A0builtin prints the names and values of all defined aliases (see\u00A0&amp;lt;strong&amp;gt;unalias )&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;bg [\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;job ] ...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Continue the specified jobs (or the current job if no jobs are given) in the background.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;command\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;command arg...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Execute the specified builtin command. (This is useful when you have a shell function with the same name as a builtin command.)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;cd\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;directory&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Switch to the specified directory (default\u00A0&amp;lt;strong&amp;gt;$HOME )&amp;lt;/strong&amp;gt;\u00A0If an entry for\u00A0&amp;lt;strong&amp;gt;CDPATH&amp;lt;/strong&amp;gt;\u00A0appears in the environment of the\u00A0&amp;lt;strong&amp;gt;cd&amp;lt;/strong&amp;gt;\u00A0command or the shell variable\u00A0&amp;lt;strong&amp;gt;CDPATH&amp;lt;/strong&amp;gt;\u00A0is set and the directory name does not begin with a slash, then the directories listed in\u00A0&amp;lt;strong&amp;gt;CDPATH&amp;lt;/strong&amp;gt;\u00A0will be searched for the specified directory. The format of\u00A0&amp;lt;strong&amp;gt;CDPATH&amp;lt;/strong&amp;gt;\u00A0is the same as that of\u00A0&amp;lt;strong&amp;gt;PATH&amp;lt;/strong&amp;gt;\u00A0In an interactive shell, the\u00A0&amp;lt;strong&amp;gt;cd&amp;lt;/strong&amp;gt;\u00A0command will print out the name of the directory that it actually switched to if this is different from the name that the user gave. These may be different either because the&amp;lt;strong&amp;gt;CDPATH&amp;lt;/strong&amp;gt;\u00A0mechanism was used or because a symbolic link was crossed.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;eval\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;string...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Concatenate all the arguments with spaces. Then re-parse and execute the command.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;exec\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;command arg...&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Unless command is omitted, the shell process is replaced with the specified program (which must be a real program, not a shell builtin or function). Any redirections on the\u00A0&amp;lt;strong&amp;gt;exec&amp;lt;/strong&amp;gt;command are marked as permanent, so that they are not undone when the\u00A0&amp;lt;strong&amp;gt;exec&amp;lt;/strong&amp;gt;\u00A0command finishes.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;exit\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;exitstatus&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Terminate the shell process. If\u00A0&amp;lt;em&amp;gt;exitstatus&amp;lt;/em&amp;gt;\u00A0is given it is used as the exit status of the shell; otherwise the exit status of the preceding command is used.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;export\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;name...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;export -p&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The specified names are exported so that they will appear in the environment of subsequent commands. The only way to un-export a variable is to unset it. The shell allows the value of a variable to be set at the same time it is exported by writing&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;export name&amp;amp;#61;value&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;With no arguments the export command lists the names of all exported variables. With the -&amp;lt;strong&amp;gt;p&amp;lt;/strong&amp;gt;option specified the output will be formatted suitably for non-interactive use.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;fc\u00A0&amp;lt;/strong&amp;gt;[-&amp;lt;strong&amp;gt;e\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;editor&amp;lt;/em&amp;gt;\u00A0] [&amp;lt;em&amp;gt;first\u00A0&amp;lt;/em&amp;gt;[&amp;lt;em&amp;gt;last&amp;lt;/em&amp;gt;\u00A0] ]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;fc -l&amp;lt;/strong&amp;gt;\u00A0[-&amp;lt;strong&amp;gt;nr&amp;lt;/strong&amp;gt;\u00A0] [&amp;lt;em&amp;gt;first\u00A0&amp;lt;/em&amp;gt;[&amp;lt;em&amp;gt;last&amp;lt;/em&amp;gt;\u00A0] ]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;fc -s\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;old&amp;amp;#61;new&amp;lt;/em&amp;gt;\u00A0] [&amp;lt;em&amp;gt;first&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The\u00A0&amp;lt;strong&amp;gt;fc&amp;lt;/strong&amp;gt;\u00A0builtin lists, or edits and re-executes, commands previously entered to an interactive shell.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-e editor&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Use the editor named by editor to edit the commands. The editor string is a command name, subject to search via the\u00A0&amp;lt;strong&amp;gt;PATH&amp;lt;/strong&amp;gt;\u00A0variable. The value in the\u00A0&amp;lt;strong&amp;gt;FCEDIT&amp;lt;/strong&amp;gt;\u00A0variable is used as a default when -&amp;lt;strong&amp;gt;e&amp;lt;/strong&amp;gt;\u00A0is not specified. If\u00A0&amp;lt;strong&amp;gt;FCEDIT&amp;lt;/strong&amp;gt;\u00A0is null or unset, the value of the&amp;lt;strong&amp;gt;EDITOR&amp;lt;/strong&amp;gt;\u00A0variable is used. If\u00A0&amp;lt;strong&amp;gt;EDITOR&amp;lt;/strong&amp;gt;\u00A0is null or unset,\u00A0ed(1) is used as the editor.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-l (ell)&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;List the commands rather than invoking an editor on them. The commands are written in the sequence indicated by the first and last operands, as affected by -&amp;lt;strong&amp;gt;r&amp;lt;/strong&amp;gt;\u00A0with each command preceded by the command number.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-n&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Suppress command numbers when listing with -l.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-r&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Reverse the order of the commands listed (with -&amp;lt;strong&amp;gt;l&amp;lt;/strong&amp;gt;\u00A0or edited (with neither -&amp;lt;strong&amp;gt;l&amp;lt;/strong&amp;gt;\u00A0nor -&amp;lt;strong&amp;gt;s )&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-s&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Re-execute the command without invoking an editor.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;first&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;last&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Select the commands to list or edit. The number of previous commands that can be accessed are determined by the value of the\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/why-would-you-use-shivi-variable-2196747&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;HISTSIZE&amp;lt;/strong&amp;gt;\u00A0variable&amp;lt;/a&amp;gt;. The value of first or last or both are one of the following:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;[&amp;amp;#43;]number&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A positive number representing a command number; command numbers can be displayed with the -&amp;lt;strong&amp;gt;l&amp;lt;/strong&amp;gt;\u00A0option.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-number&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A negative decimal number representing the command that was executed number of commands previously. For example, -1 is the immediately previous command.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A string indicating the most recently entered command that begins with that string. If the old&amp;amp;#61;new operand is not also specified with -&amp;lt;strong&amp;gt;s&amp;lt;/strong&amp;gt;\u00A0the string form of the first operand cannot contain an embedded equal sign.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The following environment variables affect the execution of fc:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;FCEDIT&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Name of the editor to use.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;HISTSIZE&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The number of previous commands that are accessible.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;fg\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;job&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Move the specified job or the current job to the foreground.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;getopts\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;optstring var&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The\u00A0&amp;lt;strong&amp;gt;POSIX&amp;lt;/strong&amp;gt;\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0command, not to be confused with the\u00A0&amp;lt;em&amp;gt;Bell Labs&amp;lt;/em&amp;gt;\u00A0-derived\u00A0getopt(1).&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The first argument should be a series of letters, each of which may be optionally followed by a colon to indicate that the option requires an argument. The variable specified is set to the parsed option.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0command deprecates the older\u00A0getopt(1) utility due to its handling of arguments containing whitespace.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0builtin may be used to obtain options and their arguments from a list of parameters. When invoked,\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0places the value of the next option from the option string in the list in the shell variable specified by\u00A0&amp;lt;em&amp;gt;var&amp;lt;/em&amp;gt;\u00A0and it&amp;amp;#39;s index in the shell variable&amp;lt;strong&amp;gt;OPTIND&amp;lt;/strong&amp;gt;\u00A0When the shell is invoked,\u00A0&amp;lt;strong&amp;gt;OPTIND&amp;lt;/strong&amp;gt;\u00A0is initialized to 1. For each option that requires an argument, the\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0builtin will place it in the shell variable\u00A0&amp;lt;strong&amp;gt;OPTARG&amp;lt;/strong&amp;gt;\u00A0If an option is not allowed for in the\u00A0&amp;lt;em&amp;gt;optstring&amp;lt;/em&amp;gt;\u00A0then\u00A0&amp;lt;strong&amp;gt;OPTARG&amp;lt;/strong&amp;gt;\u00A0will be unset.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/pass-arguments-to-bash-script-2200571&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;19&amp;quot;&amp;gt;&amp;lt;em&amp;gt;optstring&amp;lt;/em&amp;gt;&amp;lt;/a&amp;gt;\u00A0is a string of recognized option letters. If a letter is followed by a colon, the option is expected to have an argument which may or may not be separated from it by white space. If an option character is not found where expected,\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0will set the variable\u00A0&amp;lt;em&amp;gt;var&amp;lt;/em&amp;gt;\u00A0to a &amp;amp;#96;&amp;amp;#96;?&amp;amp;#39;&amp;amp;#39;\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0will then unset\u00A0&amp;lt;strong&amp;gt;OPTARG&amp;lt;/strong&amp;gt;\u00A0and write output to standard error. By specifying a colon as the first character of\u00A0&amp;lt;em&amp;gt;optstring&amp;lt;/em&amp;gt;\u00A0all errors will be ignored.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;A nonzero value is returned when the last option is reached. If there are no remaining arguments,\u00A0&amp;lt;strong&amp;gt;getopts&amp;lt;/strong&amp;gt;\u00A0will set\u00A0&amp;lt;em&amp;gt;var&amp;lt;/em&amp;gt;\u00A0to the special option, &amp;amp;#96;&amp;amp;#96;--&amp;amp;#39;&amp;amp;#39; otherwise, it will set\u00A0&amp;lt;em&amp;gt;var&amp;lt;/em&amp;gt;\u00A0to &amp;amp;#96;&amp;amp;#96;?&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The following code fragment shows how one might process the arguments for a command that can take the options [a] and [b] and the option [c] which requires an argument.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\nwhile getopts abc: f\ndo\n case $f in\n a | b) flag&amp;amp;#61;$f;;\n c) carg&amp;amp;#61;$OPTARG;;\n \\?) echo $USAGE; exit 1;;\n esac\ndone\nshift &amp;amp;#96;expr $OPTIND - 1&amp;amp;#96;\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;This code will accept any of the following as equivalent:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;\ncmd -acarg file file\ncmd -a -c arg file file\ncmd -carg -a file file\ncmd -a -carg -- file file\n&amp;lt;/pre&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;hash -rv\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;command...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The shell maintains a hash table which remembers the locations of commands. With no arguments whatsoever, the\u00A0&amp;lt;strong&amp;gt;hash&amp;lt;/strong&amp;gt;\u00A0command prints out the contents of this table. Entries which have not been looked at since the last\u00A0&amp;lt;strong&amp;gt;cd&amp;lt;/strong&amp;gt;\u00A0command are marked with an asterisk; it is possible for these entries to be invalid.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;With arguments, the\u00A0&amp;lt;strong&amp;gt;hash&amp;lt;/strong&amp;gt;\u00A0command removes the specified commands from the hash table (unless they are functions) and then locates them. With the -&amp;lt;strong&amp;gt;v&amp;lt;/strong&amp;gt;\u00A0option, hash prints the locations of the commands as it finds them. The -&amp;lt;strong&amp;gt;r&amp;lt;/strong&amp;gt;\u00A0option causes the hash command to delete all the entries in the hash table except for functions.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;jobid\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;job&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Print the process id&amp;amp;#39;s of the processes in the job. If the\u00A0&amp;lt;em&amp;gt;job&amp;lt;/em&amp;gt;\u00A0argument is omitted, the current job is used.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;jobs&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;This command lists out all the background processes which are children of the current shell process.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/find-out-which-directory-pwd-command-4022996&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;20&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;pwd&amp;lt;/strong&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Print the current directory. The builtin command may differ from the program of the same name because the builtin command remembers what the current directory is rather than recomputing it each time. This makes it faster. However, if the current directory is renamed, the builtin version of\u00A0&amp;lt;strong&amp;gt;pwd&amp;lt;/strong&amp;gt;\u00A0will continue to print the old name for the directory.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;read\u00A0&amp;lt;/strong&amp;gt;[-&amp;lt;strong&amp;gt;p\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;prompt&amp;lt;/em&amp;gt;\u00A0] [-&amp;lt;strong&amp;gt;r&amp;lt;/strong&amp;gt;\u00A0]\u00A0&amp;lt;em&amp;gt;variable...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The prompt is printed if the -&amp;lt;strong&amp;gt;p&amp;lt;/strong&amp;gt;\u00A0option is specified and the standard input is a terminal. Then a line is read from the standard input. The trailing newline is deleted from the line and the line is split as described in the section on word splitting above, and the pieces are assigned to the variables in order. At least one variable must be specified. If there are more pieces than variables, the remaining pieces (along with the characters in\u00A0&amp;lt;strong&amp;gt;IFS&amp;lt;/strong&amp;gt;\u00A0that separated them) are assigned to the last variable. If there are more variables than pieces, the remaining variables are assigned the null string. The\u00A0&amp;lt;strong&amp;gt;read&amp;lt;/strong&amp;gt;\u00A0builtin will indicate success unless EOF is encountered on input, in which case failure is returned.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;By default, unless the -&amp;lt;strong&amp;gt;r&amp;lt;/strong&amp;gt;\u00A0option is specified, the backslash &amp;amp;#96;&amp;amp;#96;\\&amp;amp;#39;&amp;amp;#39; acts as an escape character, causing the following character to be treated literally. If a backslash is followed by a newline, the backslash and the newline will be deleted.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;readonly\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;name...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;readonly -p&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The specified names are marked as read only, so that they cannot be subsequently modified or unset. The shell allows the value of a variable to be set at the same time it is marked &amp;lt;a href=&amp;quot;https://www.lifewire.com/what-is-a-read-only-file-2625983&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;21&amp;quot;&amp;gt;read only&amp;lt;/a&amp;gt; by writing&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;blockquote&amp;gt;readonly name&amp;amp;#61;value&amp;lt;/blockquote&amp;gt;&amp;lt;p&amp;gt;With no arguments the readonly command lists the names of all read only variables. With the -&amp;lt;strong&amp;gt;p&amp;lt;/strong&amp;gt;\u00A0option specified the output will be formatted suitably for non-interactive use.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;set&amp;lt;/strong&amp;gt;\u00A0[{ -&amp;lt;strong&amp;gt;options | &amp;amp;#43;options | --&amp;lt;/strong&amp;gt;\u00A0&amp;lt;em&amp;gt;arg...&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The\u00A0&amp;lt;strong&amp;gt;set&amp;lt;/strong&amp;gt;\u00A0command performs three different functions.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;With no arguments, it lists the values of all shell variables.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If options are given, it sets the specified option flags, or clears them as described in the section called Sx Argument List Processing .&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The third use of the set command is to set the values of the shell&amp;amp;#39;s positional parameters to the specified args. To change the positional parameters without changing any options, use &amp;amp;#96;&amp;amp;#96;--&amp;amp;#39;&amp;amp;#39; as the first argument to set. If no args are present, the set command will clear all the positional parameters (equivalent to executing &amp;amp;#96;&amp;amp;#96;&amp;lt;a href=&amp;quot;https://www.lifewire.com/getting-started-on-linux-desktop-2202693&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;22&amp;quot;&amp;gt;shift&amp;lt;/a&amp;gt; $# .&amp;amp;#39;&amp;amp;#39;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;variable value&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Assigns value to variable. (In general it is better to write variable&amp;amp;#61;value rather than using&amp;lt;strong&amp;gt;setvar&amp;lt;/strong&amp;gt;\u00A0&amp;lt;strong&amp;gt;setvar\u00A0&amp;lt;/strong&amp;gt;is intended to be used in functions that assign values to variables whose names are passed as parameters.)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;shift\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;n&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Shift the positional parameters n times. A\u00A0&amp;lt;strong&amp;gt;shift&amp;lt;/strong&amp;gt;\u00A0sets the value of\u00A0&amp;lt;em&amp;gt;$1&amp;lt;/em&amp;gt;\u00A0to the value of\u00A0&amp;lt;em&amp;gt;$2&amp;lt;/em&amp;gt;\u00A0the value of\u00A0&amp;lt;em&amp;gt;$2&amp;lt;/em&amp;gt;\u00A0to the value of\u00A0&amp;lt;em&amp;gt;$3&amp;lt;/em&amp;gt;\u00A0and so on, decreasing the value of\u00A0&amp;lt;em&amp;gt;$#&amp;lt;/em&amp;gt;\u00A0by one. If n is greater than the number of positional parameters,\u00A0&amp;lt;strong&amp;gt;shift&amp;lt;/strong&amp;gt;\u00A0will issue an error message, and exit with return status 2.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;times&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/linus-unix-command-expect-2201096&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;23&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;trap&amp;lt;/strong&amp;gt;\u00A0&amp;lt;em&amp;gt;action&amp;lt;/em&amp;gt;\u00A0&amp;lt;/a&amp;gt;&amp;lt;em&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/linus-unix-command-expect-2201096&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;24&amp;quot;&amp;gt;signal&amp;lt;/a&amp;gt;...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Cause the shell to parse and execute action when any of the specified signals are received. The signals are specified by signal number. If\u00A0&amp;lt;em&amp;gt;signal&amp;lt;/em&amp;gt;\u00A0is\u00A0&amp;lt;strong&amp;gt;0&amp;lt;/strong&amp;gt;\u00A0the action is executed when the shell exits.\u00A0&amp;lt;em&amp;gt;action&amp;lt;/em&amp;gt;\u00A0may be null or &amp;amp;#96;&amp;amp;#96;-&amp;amp;#39;&amp;amp;#39; the former causes the specified signal to be ignored and the latter causes the default action to be taken. When the shell forks off a &amp;lt;a href=&amp;quot;https://www.lifewire.com/subshells-in-bash-scripts-2200581&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;25&amp;quot;&amp;gt;subshell&amp;lt;/a&amp;gt;, it resets trapped (but not ignored) signals to the default action. The\u00A0&amp;lt;strong&amp;gt;trap&amp;lt;/strong&amp;gt;\u00A0command has no effect on signals that were ignored on entry to the shell.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;type\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;name ...&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Interpret each name as a command and print the resolution of the command search. Possible resolutions are: shell keyword, alias, &amp;lt;a href=&amp;quot;https://www.lifewire.com/uses-of-command-cd-2201063&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;26&amp;quot;&amp;gt;shell builtin&amp;lt;/a&amp;gt;, command, tracked alias and not found. For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;ulimit\u00A0&amp;lt;/strong&amp;gt;[-&amp;lt;strong&amp;gt;H -S&amp;lt;/strong&amp;gt;\u00A0] [-&amp;lt;strong&amp;gt;a -tfdscmlpn\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;value&amp;lt;/em&amp;gt;\u00A0] ]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Inquire about or set the hard or soft limits on processes or set new limits. The choice between hard limit (which no process is allowed to violate, and which may not be raised once it has been lowered) and soft limit (which causes processes to be signaled but not necessarily killed, and which may be raised) is made with these flags:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-H&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;set or inquire about hard limits&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-S&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;set or inquire about soft limits. If neither -&amp;lt;strong&amp;gt;H&amp;lt;/strong&amp;gt;\u00A0nor -&amp;lt;strong&amp;gt;S&amp;lt;/strong&amp;gt;\u00A0is specified, the soft limit is displayed or both limits are set. If both are specified, the last one wins.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The limit to be interrogated or set, then, is chosen by specifying any one of these flags:&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-a&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show all the current limits&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-t&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on &amp;lt;a href=&amp;quot;https://www.lifewire.com/uses-of-command-time-2201083&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;27&amp;quot;&amp;gt;CPU time&amp;lt;/a&amp;gt; (in seconds)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-f&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the largest file that can be created (in 512-byte blocks)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-d&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the data segment size of a process (in kilobytes)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-s&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the stack size of a process (in kilobytes)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-c&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the largest core dump size that can be produced (in 512-byte blocks)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-m&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the total physical memory that can be in use by a process (in kilobytes)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-l&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on how much memory a process can lock with\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/linux-unix-shell-commands-2180216&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;28&amp;quot;&amp;gt;mlock&amp;lt;/a&amp;gt;(2) (in &amp;lt;a href=&amp;quot;https://www.lifewire.com/network-data-rates-817365&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;29&amp;quot;&amp;gt;kilobytes&amp;lt;/a&amp;gt;)&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-p&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the number of processes this user can have at one time&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;-n&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;show or set the limit on the number files a process can have open at once&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If none of these is specified, it is the limit on file size that is shown or set. If value is specified, the limit is set to that number; otherwise the current limit is displayed.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Limits of an arbitrary process can be displayed or set using the\u00A0sysctl(8) utility.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;umask\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;mask&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Set the value of umask (see\u00A0umask(2)) to the specified octal value. If the argument is omitted, the umask value is printed.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;unalias\u00A0&amp;lt;/strong&amp;gt;[-&amp;lt;strong&amp;gt;a&amp;lt;/strong&amp;gt;\u00A0] [&amp;lt;em&amp;gt;name&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;If\u00A0&amp;lt;em&amp;gt;name&amp;lt;/em&amp;gt;\u00A0is specified, the shell removes that alias. If -&amp;lt;strong&amp;gt;a&amp;lt;/strong&amp;gt;\u00A0is specified, all aliases are removed.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;unset\u00A0&amp;lt;/strong&amp;gt;&amp;lt;em&amp;gt;name...&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;The specified variables and functions are unset and unexported. If a given name corresponds to both a variable and a function, both the variable and the function are unset.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;wait\u00A0&amp;lt;/strong&amp;gt;[&amp;lt;em&amp;gt;job&amp;lt;/em&amp;gt;\u00A0]&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Wait for the specified job to complete and return the exit status of the last process in the job. If the argument is omitted, wait for all jobs to complete and the return an exit status of zero.&amp;lt;/p&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;a href=&amp;quot;https://www.lifewire.com/what-to-know-more-command-4051953&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;30&amp;quot;&amp;gt;Command&amp;lt;/a&amp;gt; Line Editing&amp;lt;/h3&amp;gt;&amp;lt;p&amp;gt;When\u00A0&amp;lt;strong&amp;gt;sh&amp;lt;/strong&amp;gt;\u00A0is being used interactively from a terminal, the current command and the command history (see\u00A0&amp;lt;strong&amp;gt;fc&amp;lt;/strong&amp;gt;\u00A0in Sx Builtins ) can be edited using vi-mode command-line editing. This mode uses commands, described below, similar to a subset of those described in the vi man page. The command &amp;amp;#96;set&amp;amp;#39; -o vi enables vi-mode editing and place sh into vi insert mode. With vi-mode enabled, sh can be switched between insert mode and command mode. The editor is not described in full here, but will be in a later document. It&amp;amp;#39;s similar to vi: typing Aq ESC will throw you into command VI command mode. Hitting Aq return while in command mode will pass the line to the shell.\u00A0&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Important:&amp;lt;/strong&amp;gt;\u00A0Use the\u00A0&amp;lt;em&amp;gt;man&amp;lt;/em&amp;gt;\u00A0&amp;lt;a href=&amp;quot;https://www.lifewire.com/linux-terminal-commands-rock-your-world-2201165&amp;quot; data-component=&amp;quot;link&amp;quot; data-source=&amp;quot;inlineLink&amp;quot; data-type=&amp;quot;internalLink&amp;quot; data-ordinal=&amp;quot;31&amp;quot;&amp;gt;command&amp;lt;/a&amp;gt; (&amp;lt;em&amp;gt;% man&amp;lt;/em&amp;gt;) to see how a command is used on your particular computer.&amp;lt;/p&amp;gt;"^^<http://www.w3.org/2001/XMLSchema#string>
<https://www.lifewire.com/ash-linux-command-4095519>