手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网站运营>建站经验>列表

bash manual (保存)

来源:互联网 作者:west263.com 时间:2008-04-16
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

The shell then parses these tokens into commands and other constructs, removes the special meaning of certain words or characters, expands others, redirects input and output as needed, executes the specified command, waits for the command's exit status, and makes that exit status available for further inspection or processing.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

3.1.1 Shell Operation
The following is a brief description of the shell's operation when it reads and executes a command. Basically, the shell does the following:


Reads its input from a file (see section 3.8 Shell Scripts), from a string supplied as an argument to the `-c' invocation option (see section 6.1 Invoking Bash), or from the user's terminal.

Breaks the input into words and operators, obeying the quoting rules described in 3.1.2 Quoting. These tokens are separated by metacharacters. Alias expansion is performed by this step (see section 6.6 Aliases).

Parses the tokens into simple and compound commands (see section 3.2 Shell Commands).

Performs the various shell expansions (see section 3.5 Shell Expansions), breaking the expanded tokens into lists of filenames (see section 3.5.8 Filename Expansion) and commands and arguments.

Performs any necessary redirections (see section 3.6 Redirections) and removes the redirection operators and their operands from the argument list.

Executes the command (see section 3.7 Executing Commands).

Optionally waits for the command to complete and collects its exit status (see section 3.7.5 Exit Status).

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

3.1.2 Quoting
3.1.2.1 Escape Character How to remove the special meaning from a single character.
3.1.2.2 Single Quotes How to inhibit all interpretation of a sequence of characters.
3.1.2.3 Double Quotes How to suppress most of the interpretation of a sequence of characters.
3.1.2.4 ANSI-C Quoting How to expand ANSI-C sequences in quoted strings.

3.1.2.5 Locale-Specific Translation How to translate strings into different languages.

Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion.

Each of the shell metacharacters (see section 2. Definitions) has special meaning to the shell and must be quoted if it is to represent itself. When the command history expansion facilities are being used, the history expansion character, usually `!', must be quoted to prevent history expansion. See section 9.1 Bash History Facilities, for more details concerning history expansion. There are three quoting mechanisms: the escape character, single quotes, and double quotes.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

3.1.2.1 Escape Character
A non-quoted backslash `\' is the Bash escape character. It preserves the literal value of the next character that follows, with the exception of newline. If a \newline pair appears, and the backslash itself is not quoted, the \newline is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).


--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

3.1.2.2 Single Quotes
Enclosing characters in single quotes (`'') preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

3.1.2.3 Double Quotes
Enclosing characters in double quotes (`"') preserves the literal value of all characters within the quotes, with the exception of `$', ``', and `\'. The characters `$' and ``' retain their special meaning within double quotes (see section 3.5 Shell Expansions). The backslash retains its special meaning only when followed by one of the following characters: `$', ``', `"', `\', or newline. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash.

The special parameters `*' and `@' have special meaning when in double quotes (see section 3.5.3 Shell Parameter Expansion).

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!