3 test \- set status according to condition
9 evaluates the expression
11 If the value is true the exit status is null; otherwise the
12 exit status is non-null.
13 If there are no arguments the exit status is non-null.
15 The following primitives are used to construct
17 .TP "\w'\fIn1 \fL-eq \fIn2\fLXX'u"
19 True if the file exists (is accessible) and is readable.
23 True if the file exists and is writable.
26 True if the file exists and has execute permission.
29 True if the file exists.
32 True if the file exists and is a plain file.
35 True if the file exists and is a directory.
38 True if the file exists and has a size greater than zero.
41 True if the open file whose file descriptor number is
48 True if the file exists and is append-only.
51 True if the file exists and is exclusive-use.
54 True if the file exists and is temporary.
75 is not the null string.
79 True if the length of string
84 True if the length of string
93 are arithmetically equal.
94 Any of the comparisons
101 may be used in place of
103 The (nonstandard) construct
105 meaning the length of
107 may be used in place of an integer.
112 is newer than (modified after) file
118 is older than (modified before) file
124 is older than (modified before) time
128 is a integer followed by the letters
136 it represents current time minus the specified time.
137 If there is no letter, it represents seconds since
139 You can also concatenate mixed units. For example,
141 means three days and twelve hours ago.
144 These primaries may be combined with the
146 .TP "\w'\fL( \fIexpr\fL )XX'u"
148 unary negation operator
159 operator; higher precedence than
163 parentheses for grouping.
172 return false; they are recognized for compatibility with POSIX.
174 Notice that all the operators and flags are separate
177 Notice also that parentheses and equal signs are meaningful
180 and must be enclosed in quotes.
183 is a dubious way to check for specific character strings:
184 it uses a process to do what an
186 match or switch statement can do.
187 The first example is not only inefficient but wrong, because
189 understands the purported string
194 if (test $1 '=' "-c") echo OK # wrong!
205 is in the current directory.
207 .B test -f abc -o -d abc
209 .B /usr/local/plan9/src/cmd/test.c