Welcome to little lamb

Code » anopa » jjk » tree

[jjk] / doc / aa-test.pod

=head1 NAME

aa-test - Test file types

=head1 SYNOPSIS

B<aa-test> [B<-D>] [B<-O> I<FILE|FD>] [B<-b> | B<-d> | B<-e> | B<-f> | B<-L> |
B<-p> | B<-S> | B<-r> | B<-w> | B<-x>] [B<-R> [I<TIMES>]] I<FILE>

=head1 OPTIONS

=over

=item B<-b, --block>

Test whether I<FILE> exists and is a block special

=item B<-D, --double-output>

Enable double-output mode. Instead of using stdout for regular output, and
stderr for warnings and errors, everything is sent both to stdout and stderr.
This is intended to redirect stderr to a log file, so full output can be both
shown on console and logged.

B<Deprecation warning:> Note that this option has been deprecated and will be
removed in the next version; You should use B<--log-file> instead.

=item B<-d, --directory>

Test whether I<FILE> exists and is a directory

=item B<-e, --exists>

Test whether I<FILE> exists

=item B<-f, --file>

Test whether I<FILE> exists and is a regular file

=item B<-h, --help>

Show help screen and exit.

=item B<-L, --symlink>

Test whether I<FILE> exists and is a symlink

=item B<-O, --log-file> I<FILE|FD>

Will duplicate all output (everything written to stdout or stderr) to the given
file or file descriptor. I<FILE|FD> can either be a (previously opened for
writing) file descriptor (must be > 2), or a file which will then be opened in
append mode.

=item B<-p, --pipe>

Test whether I<FILE> exists and is a named pipe (FIFO)

=item B<-R, --repeat> [I<TIMES>]

If I<FILE> doesn't exist, wait 1 second and try again, repeating the test up to
I<TIMES> times. By default 0 is used, meaning repeat the test forever.

=item B<-r, --read>

Test whether I<FILE> exists and read permission is granted

=item B<-S, --socket>

Test whether I<FILE> exists and is a socket

=item B<-V, --version>

Show version information and exit.

=item B<-w, --write>

Test whether I<FILE> exists and write permission is granted

=item B<-x, --execute>

Test whether I<FILE> exists and execute (search) permission is granted

=back

=head1 DESCRIPTION

B<aa-test>(1) is a simple tool to check file types/permissions as specified, and
exits with a return code indicating whether the test passed or not.

=head1 RETURN CODES

Return codes are somewhat unified inside B<anopa>. Odd return codes represent
fatal errors, and are detailled in B<anopa-rc>(1)

Possible even return codes for B<aa-test>(1) are:

=over

=item B<2>
I<FILE> doesn't exist

=item B<4>
I<FILE> exists, but the rest of the test failed (e.g. wrong type)

=back