Text-only | Table of Contents (frame/ no frame) |
(16) Conditional Tests |
![]() ![]() ![]() |
test
command, or its alias, [
, or the ksh/bash built-in [[ ... ]]
command, which has slightly different options, or it can be any command which returns
a suitable exit status. Zero is taken to be "True", while any non-zero value is "False".
Note that this is backwards from the C language convention.
-e file
-f file
-d file
-r file
-w
= writable, -x
= executable, -L
= is a symlink.
-s file
-t filedescriptor
-n "string"
-z "string"
$variable = text
$variable < text
>
= comes after
cond-tests.src last modified Feb 11, 2005 | Introduction | Table of Contents (frame/no frame) |
Printable (single file) |
© Dartmouth College |