if.1

来自「UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱」· 1 代码 · 共 87 行

1
87
字号
.th IF I 5/2/74.sh NAMEif \*-  conditional command.sh SYNOPSIS.bd ifexpr command [ arg ... ].sh DESCRIPTION.it Ifevaluates the expression.it expr,and if its value istrue,executes the given.it commandwith the given arguments..s3The following primitives are used to constructthe.it expr:.s3.lp +13 13\fB\*-r\fR file	true if the file exists and is readable..s3.lp +13 13\fB\*-w \fRfile	true if the file exists and is writable..s3.lp +13 13s1 \fB= \fRs2	trueif the strings.it s1and.it s2are equal..s3.lp +13 13s1 \fB!= \fRs2	trueif the strings.it s1and.it s2are not equal..s3.lp +13 13\fB{ \fRcommand \fB}\fR	The bracketed command isexecuted to obtain theexit status.Status zero is considered.it true.The command mustnotbe another.it if..s3.i0These primaries may be combined with thefollowing operators:.s3.lp +13 13\fB!\fR	unary negation operator.s3.lp +13 13\fB\*-a\fR	binary.it andoperator.s3.lp +13 13\fB\*-o\fR	binary.it oroperator.s3.lp +13 13\fB( \fRexpr\fB )\fR	parentheses for grouping..s3.i0.bd \*-ahas higher precedence than.bd \*-o.Notice that all the operators and flags are separatearguments to.it ifand hence must be surrounded by spaces.Notice also that parentheses are meaningfulto the Shell and must be escaped..sh "SEE ALSO"sh (I), find (I).sh BUGS

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?