test man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

test(1)								       test(1)

       test - condition evaluation command


       The  command  evaluates	the expression expr and, if its value is True,
       returns a zero (true) exit status; otherwise, a	nonzero	 (false)  exit
       status is returned.  also returns a nonzero exit status if there are no
       arguments.  The following primitives are used to construct expr:

	      True if	     file exists and is readable.

	      True if	     file exists and is writable.

	      True if	     file exists and is executable.

	      True if	     file exists and is a regular file.

	      True if	     file exists and is a directory.

	      True if	     file exists and is a character special file.

	      True if	     file exists and is a block special file.

	      True if	     file exists and is a named pipe (fifo).

	      True if	     file exists and its set-user-ID bit is set.

	      True if	     file exists and its set-group-ID bit is set.

	      True if	     file exists and its sticky bit is set.

	      True if	     file exists and has a size greater than zero.

	      True if	     file exists and is a symbolic link.

	      True if the open file whose file descriptor number is
			     fildes (1 by default) is associated with a termi‐
			     nal device.

	      True if the length of string
			     s1 is zero.

	      True if the length of the string
			     s1 is non-zero.

	      True if strings
			     s1 and s2 are identical.

	      True if strings
			     s1 and s2 are not identical.

	      s1	     True if s1 is not the null string.

	      True if the integers
			     n1	 and  n2  are algebraically equal.  Any of the
			     comparisons and can be used in place of

       These primaries can be combined with the following operators:

	      Unary negation operator.

	      Binary AND operator.

	      Binary OR operator
			     has higher precedence than

	      Parentheses for grouping.

       Note that all the operators and flags are separate  arguments  to  Note
       also  that  parentheses are significant to the shell and therefore must
       be escaped.  All file test operators return success if the argument  is
       a symbolic link that points to a file of the file type being tested.

       is interpreted directly by the shell, and therefore does not exist as a
       separate executable program.

   International Code Set Support
       Single byte and multibyte character code sets are supported.

       Exit if there are not two or three arguments:

       Create a new file containing the text  string  if  the  file  does  not
       already exist:

       Wait for myfile to become non-readable:

       When  the  form of this command is used, the matching must be the final
       argument, and both must be separate arguments from the  arguments  they
       enclose (white space delimiters required.

       Parentheses  and other special shell metacharacters intended to be han‐
       dled by test must be escaped or quoted when invoking from a shell.

       Avoid such problems when comparing strings by inserting a  non-operator
       character at the beginning of both operands:

       This approach does not work with numeric comparisons or the unary oper‐
       ators because it would affect the operand being checked.

       was developed by the University of California, Berkeley and HP.

       find(1), sh-posix(1), sh(1).


List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net