Browsing Chinese (Simplified) translation

553 of 586 results
553.
Evaluate conditional expression.

Exits with a status of 0 (true) or 1 (false) depending on
the evaluation of EXPR. Expressions may be unary or binary. Unary
expressions are often used to examine the status of a file. There
are string operators and numeric comparison operators as well.

The behavior of test depends on the number of arguments. Read the
bash manual page for the complete specification.

File operators:

-a FILE True if file exists.
-b FILE True if file is block special.
-c FILE True if file is character special.
-d FILE True if file is a directory.
-e FILE True if file exists.
-f FILE True if file exists and is a regular file.
-g FILE True if file is set-group-id.
-h FILE True if file is a symbolic link.
-L FILE True if file is a symbolic link.
-k FILE True if file has its `sticky' bit set.
-p FILE True if file is a named pipe.
-r FILE True if file is readable by you.
-s FILE True if file exists and is not empty.
-S FILE True if file is a socket.
-t FD True if FD is opened on a terminal.
-u FILE True if the file is set-user-id.
-w FILE True if the file is writable by you.
-x FILE True if the file is executable by you.
-O FILE True if the file is effectively owned by you.
-G FILE True if the file is effectively owned by your group.
-N FILE True if the file has been modified since it was last read.

FILE1 -nt FILE2 True if file1 is newer than file2 (according to
modification date).

FILE1 -ot FILE2 True if file1 is older than file2.

FILE1 -ef FILE2 True if file1 is a hard link to file2.

String operators:

-z STRING True if string is empty.

-n STRING
STRING True if string is not empty.

STRING1 = STRING2
True if the strings are equal.
STRING1 != STRING2
True if the strings are not equal.
STRING1 < STRING2
True if STRING1 sorts before STRING2 lexicographically.
STRING1 > STRING2
True if STRING1 sorts after STRING2 lexicographically.

Other operators:

-o OPTION True if the shell option OPTION is enabled.
-v VAR True if the shell variable VAR is set.
-R VAR True if the shell variable VAR is set and is a name
reference.
! EXPR True if expr is false.
EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.
EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.

arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,
-lt, -le, -gt, or -ge.

Arithmetic binary operators return true if ARG1 is equal, not-equal,
less-than, less-than-or-equal, greater-than, or greater-than-or-equal
than ARG2.

Exit Status:
Returns success if EXPR evaluates to true; fails if EXPR evaluates to
false or an invalid argument is given.
There are line breaks here. Each one represents a line break. Start a new line in the equivalent position in the translation.
There are leading/trailing spaces here. Each one represents a space character. Enter a space in the equivalent position in the translation.
对条件表达式进行求值。

根据 <表达式> 的求值结果,以状态 0(真)或 1(假)退出。
表达式可以是一元的或者二元的。一元表达式通常用于检测文件状态。
同时还有字符串运算符和数值比较运算符。

test 的行为取决于参数的数量。请阅读 bash 手册页以获取完整的
说明文档。

文件运算符:

-a 文件 如果 <文件> 存在则为真。
-b 文件 如果 <文件> 为块特殊文件则为真。
-c 文件 如果 <文件> 为字符特殊文件则为真。
-d 文件 如果 <文件> 为目录则为真。
-e 文件 如果 <文件> 存在则为真。
-f 文件 如果 <文件> 存在且为普通文件则为真。
-g 文件 如果 <文件> 设置了 setgid 位则为真。
-h 文件 如果 <文件> 为符号链接则为真。
-L 文件 如果 <文件> 为符号链接则为真。
-k 文件 如果 <文件> 设置了粘滞位 (sticky bit) 则为真。
-p 文件 如果 <文件> 为命名管道则为真。
-r 文件 如果 <文件> 对您是可读的则为真。
-s 文件 如果 <文件> 存在且不为空则为真。
-S 文件 如果 <文件> 是套接字则为真。
-t FD 如果文件描述符 <FD> 已在一个终端上打开则为真。
-u 文件 如果 <文件> 设置了 setuid 位则为真。
-w 文件 如果 <文件> 对您是可写的则为真。
-x 文件 如果 <文件> 对您是可执行的则为真。
-O 文件 如果 <文件> 是被您(有效 uid)所有的则为真。
-G 文件 如果 <文件> 是被您的组(有效 gid)所有的则为真。
-N 文件 如果 <文件> 上次读取之后被修改过则为真。

文件1 -nt 文件2 如果 <文件1> 新于 <文件2> 则为真(根据修改日期)。

文件1 -ot 文件2 如果 <文件1> 旧于 <文件2> 则为真。

文件1 -ef 文件2 如果 <文件1> 是到 <文件2> 的硬链接则为真。

字符串运算符:

-z 字符串 如果 <字符串> 为空则为真。

-n 字符串
字符串 如果 <字符串> 不为空则为真。

字符串1 = 字符串2
如果两个字符串相等则为真。
字符串1 != 字符串2
如果两个字符串不相等则为真。
字符串1 < 字符串2
如果按字典序 <字符串1> 在 <字符串2> 之前则为真。
字符串1 > 字符串2
如果按字典序 <字符串1> 在 <字符串2> 之后则为真。

其他运算符:

-o 选项 如果指定的 shell 选项 <选项> 启用则为真。
-v 变量 如果指定的 shell 变量 <变量> 已设定则为真。
-R 变量 如果指定的 shell 变量 <变量> 已设定且为名称引用则为真。
! 表达式 如果 <表达式> 为假则为真。
表达式1 -a 表达式2
如果 <表达式1> 和 <表达式2> 都为真则为真。
表达式1 -o 表达式2
如果 <表达式1> 和 <表达式2> 中任何一个为真则为真。

参数1 运算符 参数2
算术测试。<运算符> 可以是 -eq、-ne、
-lt、-le、-gt 或 -ge 中的一个。

二元算术运算符返回真,如果 <参数1> 等于、不等于、小于、小于等于、
大于,或者大于等于 <参数2>。

退出状态:
如果 <表达式> 求值结果为真则返回成功;如果 <表达式> 求值结果为假,
或者使用了无效的参数,则返回失败。
Translated by Wenbin Lv
Located in builtins.c:1262
553 of 586 results

This translation is managed by Ubuntu Simplified Chinese Translators, assigned by Ubuntu Translators.

You are not logged in. Please log in to work on translations.