1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 03:17:58 +01:00

test: add page

This commit is contained in:
Igor Shubovych 2015-12-13 00:08:54 +02:00
parent 07221fb02a
commit 893f4459b6

24
pages/common/test.md Normal file
View file

@ -0,0 +1,24 @@
# test
> Evaluate condition.
> If it is true, returns 0 exit status, otherwise returns 1.
- Test if given variable is equal to given string
`test $MY_VAR == '/bin/zsh'`
- Test if given variable is empty
`test -z $GIT_BRANCH`
- Test if file exists
`test -e {{filename}}`
- Test if directory not exists
`test ! -d {{path/to/directory}}`
- If-else statement
`test {{condition}} && echo "true" || echo "false"`