mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-09-11 03:55:31 +03:00
[: add Chinese translation (#6381)
This commit is contained in:
parent
fe35df460c
commit
2c5efc2a73
25
pages.zh/common/[.md
Normal file
25
pages.zh/common/[.md
Normal file
@ -0,0 +1,25 @@
|
||||
# [
|
||||
|
||||
> 评估条件。
|
||||
> 如果条件评估为真返回 0,如果评估为假返回 1.
|
||||
> 更多信息:<https://www.gnu.org/software/coreutils/test>.
|
||||
|
||||
- 测试给定变量是否与给定字符串相同:
|
||||
|
||||
`[ "{{$VARIABLE}}" == "{{/bin/zsh}}" ]`
|
||||
|
||||
- 测试给定变量是否为空值:
|
||||
|
||||
`[ -z "{{$GIT_BRANCH}}" ]`
|
||||
|
||||
- 测试某个文件是否存在:
|
||||
|
||||
`[ -f "{{文件}}" ]`
|
||||
|
||||
- 测试某个目录是否存在:
|
||||
|
||||
`[ ! -d "{{目录}}" ]`
|
||||
|
||||
- If-else 语句:
|
||||
|
||||
`[ {{条件语句}} ] && {{echo "true"}} || {{echo "false"}}`
|
Loading…
Reference in New Issue
Block a user