March 2002
Beginner
504 pages
10h 47m
English
This section summarizes conditional expressions or tests. Conditional expressions are mainly used with the test command in conjunction with if statements and while and until loops.
The following conditional expressions are used to perform file and directory related tests.
| -a file | true if file exists (ksh, bash, and zsh only) |
| -b file | true if file is a block special device |
| -c file | true if file is a character special device |
| -d dir | true if dir is a directory |
| -e file | true if file exists |
| -f file | true if file is a regular file |
| -g file | true if file has the SGID permission bit set |
| -G path | true if path exists and its group matches the user's current group ID (Linux and BSD systems only) |
| -h file | true if file is a symbolic ... |
Read now
Unlock full access