Manual Pages for UNIX Darwin command on man test
MyWebUniversity

Manual Pages for UNIX Darwin command on man test

TEST(1) BSD General Commands Manual TEST(1)

NAME

tteesstt, [tteesstt - condition evaluation utility

SYNOPSIS

tteesstt expression [tteesstt expression ]

DESCRIPTION

The tteesstt utility evaluates the expression and, if it evaluates to true, returns a zero (true) exit status; otherwise it returns 1 (false). If

there is no expression, test also returns 1 (false).

All operators and flags are separate arguments to the tteesstt utility. The following primaries are used to construct expression:

-bb file True if file exists and is a block special file.

-cc file True if file exists and is a character special file.

-dd file True if file exists and is a directory.

-ee file True if file exists (regardless of type).

-ff file True if file exists and is a regular file.

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

-hh file True if file exists and is a symbolic link. This operator

is retained for compatibility with previous versions of

this program. Do not rely on its existence; use -LL instead.

-kk file True if file exists and its sticky bit is set.

-nn string True if the length of string is nonzero.

-pp file True if file is a named pipe (FIFO).

-rr file True if file exists and is readable.

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

-tt filedescriptor

True if the file whose file descriptor number is filedescriptor is open and is associated with a terminal.

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

-ww file True if file exists and is writable. True indicates only

that the write flag is on. The file is not writable on a

read-only file system even if this test indicates true.

-xx file True if file exists and is executable. True indicates only

that the execute flag is on. If file is a directory, true indicates that file can be searched.

-zz string True if the length of string is zero.

-LL file True if file exists and is a symbolic link.

-OO file True if file exists and its owner matches the effective

user id of this process.

-GG file True if file exists and its group matches the effective

group id of this process.

-SS file True if file exists and is a socket.

file1 -nntt file2

True if file1 exists and is newer than file2.

file1 -oott file2

True if file1 exists and is older than file2.

file1 -eeff file2

True if file1 and file2 exist and refer to the same file. string True if string is not the null string. s1 == s2 True if the strings s1 and s2 are identical. s1 !!== s2 True if the strings s1 and s2 are not identical. s1 << s2 True if string s1 comes before s2 based on the ASCII value of their characters. s1 >> s2 True if string s1 comes after s2 based on the ASCII value of their characters. s1 True if s1 is not the null string.

n1 -eeqq n2 True if the integers n1 and n2 are algebraically equal.

n1 -nnee n2 True if the integers n1 and n2 are not algebraically equal.

n1 -ggtt n2 True if the integer n1 is algebraically greater than the

integer n2.

n1 -ggee n2 True if the integer n1 is algebraically greater than or

equal to the integer n2.

n1 -lltt n2 True if the integer n1 is algebraically less than the inte-

ger n2.

n1 -llee n2 True if the integer n1 is algebraically less than or equal

to the integer n2. These primaries can be combined with the following operators: !! expression True if expression is false.

expression1 -aa expression2

True if both expression1 and expression2 are true.

expression1 -oo expression2

True if either expression1 or expression2 are true. ((expression)) True if expression is true.

The -aa operator has higher precedence than the -oo operator.

GRAMMAR AMBIGUITY The tteesstt grammar is inherently ambiguous. In order to assure a degree of consistency, the cases described in IEEE Std 1003.2 (``POSIX.2'') section 4.62.4, are evaluated consistently according to the rules specified in the standards document. All other cases are subject to the ambiguity in the command semantics.

RETURN VALUES

The tteesstt utility exits with one of the following values: 0 expression evaluated to true. 1 expression evaluated to false or expression was missing. >1 An error occurred. STANDARDS The tteesstt utility implements a superset of the IEEE Std 1003.2 (``POSIX.2'') specification. BSD May 31, 1993 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™