Ftest
checks the specified attribute of
arg
according to
test
and yields an exit status signifying the result.
For all
tests
apart from
-t,
arg
is the name of the file to be tested;
for
-t,
it is the number of a file descriptor.
Available tests are:
- -d
- True if the file exists and is a directory.
- -e
- True if the file exists.
- -f
- True if the file exists and is a regular file.
- -r
- True if the file exists and is readable.
- -s
- True if the file exists and has non-zero size.
- -t
- True if the open file represented by
the number
arg
represents the same file as
/dev/cons.
- -w
- True if the file exists and is writable.
- -x
- True if the file exists and is executable.
Newer
checks whether
file1
exists and is no older than
file2,
which must also exist;
if so, it yields a true exit status.
Otherwise, it yields an error status.
Neither file may be a directory.