Skip to content

Commit 403eeba

Browse files
committed
docs(condition): edit [
1 parent 9752e95 commit 403eeba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/condition.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ $ echo $?
125125

126126
上面的例子中,`test`命令采用两种写法,判断`/etc/hosts`文件是否存在,这两种写法是等价的。命令执行后,返回值为`0`,表示该文件确实存在。
127127

128+
实际上,`[`这个字符是`test`命令的一种简写形式,可以看作是一个独立的命令,这解释了为什么它后面必须有空格。
129+
128130
下面把`test`命令的三种形式,用在`if`结构中,判断一个文件是否存在。
129131

130132
```bash

0 commit comments

Comments
 (0)