- 论坛徽章:
- 1
|
另外还想问下,的set +e、set -e、printf引号中的\r分别是意思?
虫虫2003 发表于 2011-03-02 23:40 这个你看bash的帮助页就知道了。
set [+abefhkmnptuvxBCEHPT] [+o option] [arg ...]
Without options, the name and value of each shell variable are
displayed in a format that can be reused as input for setting or
resetting the currently-set variables. Read-only variables can‐
not be reset. In posix mode, only shell variables are listed.
The output is sorted according to the current locale. When
options are specified, they set or unset shell attributes. Any
arguments remaining after option processing are treated as val‐
ues for the positional parameters and are assigned, in order, to
$1, $2, ... $n. Options, if specified, have the following
meanings:
-a Automatically mark variables and functions which are
modified or created for export to the environment of
subsequent commands.
-b Report the status of terminated background jobs immedi‐
ately, rather than before the next primary prompt. This
is effective only when job control is enabled.
-e Exit immediately if a pipeline (which may consist of a
single simple command), a subshell command enclosed in
parentheses, or one of the commands executed as part of
a command list enclosed by braces (see SHELL GRAMMAR
above) exits with a non-zero status. The shell does not
exit if the command that fails is part of the command |
|