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

bash manual (保存)

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

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

3.1.2.4 ANSI-C Quoting
Words of the form $'string' are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows:


\a
alert (bell)
\b
backspace
\e
an escape character (not ANSI C)
\f
form feed
\n
newline
\r
carriage return
\t
horizontal tab
\v
vertical tab
\
backslash
\'
single quote
\nnn
the eight-bit character whose value is the octal value nnn (one to three digits)
\xHH
the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)
\cx
a control-x character
The expanded result is single-quoted, as if the dollar sign had not been present.

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

3.1.2.5 Locale-Specific Translation
A double-quoted string preceded by a dollar sign (`$') will cause the string to be translated according to the current locale. If the current locale is C or POSIX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.

Some systems use the message catalog selected by the LC_MESSAGES shell variable. Others create the name of the message catalog from the value of the TEXTDOMAIN shell variable, possibly adding a suffix of `.mo'. If you use the TEXTDOMAIN variable, you may need to set the TEXTDOMAINDIR variable to the location of the message catalog files. Still others use both variables in this fashion: TEXTDOMAINDIR/LC_MESSAGES/LC_MESSAGES/TEXTDOMAIN.mo.

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

3.1.3 Comments
In a non-interactive shell, or an interactive shell in which the interactive_comments option to the shopt builtin is enabled (see section 4.2 Bash Builtin Commands), a word beginning with `#' causes that word and all remaining characters on that line to be ignored. An interactive shell without the interactive_comments option enabled does not allow comments. The interactive_comments option is on by default in interactive shells. See section 6.3 Interactive Shells, for a description of what makes a shell interactive.

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

3.2 Shell Commands
A simple shell command such as echo a b c consists of the command itself followed by arguments, separated by spaces.

More complex shell commands are composed of simple commands arranged together in a variety of ways: in a pipeline in which the output of one command becomes the input of a second, in a loop or conditional construct, or in some other grouping.


3.2.1 Simple Commands The most common type of command.
3.2.2 Pipelines Connecting the input and output of several commands.
3.2.3 Lists of Commands How to execute commands sequentially.
3.2.4 Looping Constructs Shell commands for iterative action.
3.2.5 Conditional Constructs Shell commands for conditional execution.
3.2.6 Grouping Commands Ways to group commands.

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

3.2.1 Simple Commands
A simple command is the kind of command encountered most often. It's just a sequence of words separated by blanks, terminated by one of the shell's control operators (see section 2. Definitions). The first word generally specifies a command to be executed, with the rest of the words being that command's arguments.

The return status (see section 3.7.5 Exit Status) of a simple command is its exit status as provided by the POSIX 1003.1 waitpid function, or 128 n if the command was terminated by signal n.

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

3.2.2 Pipelines
A pipeline is a sequence of simple commands separated by `|'.

The format for a pipeline is [time [-p]] [!] command1 [| command2 ...]


The output of each command in the pipeline is connected via a pipe to the input of the next command. That is, each command reads the previous command's output.

The reserved word time causes timing statistics to be printed for the pipeline once it finishes. The statistics currently consist of elapsed (wall-clock) time and user and system time consumed by the command's execution. The `-p' option changes the output format to that specified by POSIX. The TIMEFORMAT variable may be set to a format string that specifies how the timing information should be displayed. See section 5.2 Bash Variables, for a description of the available formats. The use of time as a reserved word permits the timing of shell builtins, shell functions, and pipelines. An external time command cannot time these easily.

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