GNU Info

Info Node: (sh-utils.info)test invocation

(sh-utils.info)test invocation


Next: expr invocation Prev: true invocation Up: Conditions
Enter node , (file) or (file)node

`test': Check file types and compare values
===========================================

   `test' returns a status of 0 (true) or 1 (false) depending on the
evaluation of the conditional expression EXPR.  Each part of the
expression must be a separate argument.

   `test' has file status checks, string operators, and numeric
comparison operators.

   Because most shells have a built-in command by the same name, using
the unadorned command name in a script or interactively may get you
different functionality than that described here.

   Besides the options below, `test' accepts a lone `--help' or
`--version'.  Note: Common options.  A single non-option argument is
also allowed: `test' returns true if the argument is not null.

File type tests
-[bcdfhLpSt]
Access permission tests
-[gkruwxOG]
File characteristics tests
-e -s -nt -ot -ef
String tests
-z -n = !=
Numeric tests
-eq -ne -lt -le -gt -ge
Connectives for test
! -a -o

automatically generated by info2www version 1.2.2.9