home *** CD-ROM | disk | FTP | other *** search
-
-
-
- TEST(1) TEST(1)
-
-
- NNAAMMEE
- test - test condition (Korn and 8th edition)
-
- SSYYNNOOPPSSIISS
- tteesstt _e_x_p_r_e_s_s_i_o_n
- [[ _e_x_p_r_e_s_s_i_o_n ]]
-
- DDEESSCCRRIIPPTTIIOONN
- TTeesstteevvaalluuaatteess tthhee _e_x_p_r_e_s_s_i_o_n aanndd rreettuurrnnss zzeerroo ssttaattuuss iiff
- ttrruuee,, aanndd nnoonn--zzeerroo ssttaattuuss ootthheerrwwiissee.. IItt iiss nnoorrmmaallllyy uusseedd
- aass tthhee ccoonnttrroolllliinngg ccoommmmaanndd ooff tthhee iiff aanndd wwhhiillee ssttaatteemmeennttss..
-
- The following basic expressions are available.
-
- -r file file exists and is
- readable
- -w file file exists and is
- writable
- -x file file exists and is
- executable
- -f file file is a regular
- file
- -d file file is a directory
- -c file file is a character
- special device
- -b file file is a block spe-
- cial device
- -p file file is a named pipe
- -u file file mode has setuid
- bit
- -g file file mode has setgid
- bit
- -k file file mode has sticky
- bit
- -s file file is not empty
- -L file file is a symbolic
- link
- -S file file is a socket
- file -nt file first file is newer
- than second file
- file -ot file first file is older
- than second file
- file -ef file first file is the
- same file as second
- -t filedes file descriptor is a
- tty device
-
- string string is not null
- -z string string is null
- -n string string is not null
- string = string strings are equal
- string != string strings are not equal
-
- number -eq number numbers compare equal
-
-
-
- Korn shell January 1988 1
-
-
-
-
-
- TEST(1) TEST(1)
-
-
- number -ne number numbers compare not
- equal
- number -ge number numbers compare
- greater than or equal
- number -gt number numbers compare
- greater than
- number -le number numbers compare less
- than or equal
- number -lt number numbers compare less
- than
-
- The above basic expressions may be combined with the fol-
- lowing operators.
-
- expr -o expr logical or
- expr -a expr logical and
- ! expr logical not
- ( expr ) grouping
-
- AAUUTTHHOORR
- Erik Baalbergen. Modified by Arnold Robbins.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Korn shell January 1988 2
-
-
-