sbase/test.1

76 lines
1.8 KiB
Groff
Raw Normal View History

.Dd January 30, 2015
.Dt TEST 1
.Os sbase
.Sh NAME
.Nm test
.Nd check file types and compare values
.Sh SYNOPSIS
.Nm
.Ar EXPRESSION
.Sh DESCRIPTION
Exit with the status determined by
.Ar EXPRESSION .
.Sh OPTIONS
.Bl -tag -width Ds
.It ! Ar EXPRESSION
invert EXPRESSION
.It Fl b Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is block special
.It Fl c Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is character special
.It Fl d Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is a directory
.It Fl e Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists
.It Fl f Ar FILE
FILE exists and is a regular file
.It Fl g Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is set-group-ID
.It Fl h Ar FILE
FILE exists and is a symbolic link (same as
.Fl L )
.It Fl k Ar FILE
FILE exists and its sticky bit is set
.It Fl L Ar FILE
FILE exists and is a symbolic link (same as
.Fl h )
.It Fl n Ar STRING
2013-07-23 12:03:22 +00:00
the length of STRING is nonzero
.It Fl p Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is a named pipe
.It Fl r Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and read permission is granted
.It Fl S Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and is a socket
.It Fl s Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and has a size greater than zero
.It Fl t Ar FD
2013-07-23 12:03:22 +00:00
file descriptor FD is opened on a terminal
.It Fl u Ar FILE
2013-07-23 12:03:22 +00:00
exists and its set-user-ID bit is set
.It Fl w Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and write permission is granted
.It Fl x Ar FILE
2013-07-23 12:03:22 +00:00
FILE exists and execute (or search) permission is granted
.It Fl z Ar STRING
2013-07-23 12:03:22 +00:00
the length of STRING is zero
.It s1 = s2
True if the strings s1 and s2 are identical
.It s1 != s2
True if the strings s1 and s2 are not identical
.It s1
True if s1 is not the null string
.It n1 -eq n2
True if the integers n1 and n2 are equal
.It n1 -ne n2
True if the integers n1 and n2 are not equal
.It n1 -gt n2
True if the integer n1 is greater than the integer n2
.It n1 -ge n2
True if the integer n1 is great than or equal to the integer n2
.It n1 -lt n2
True if the integer n1 is less than the integer n2
.It n1 -le n2
True if the integer n1 is less than or equal to the integer n2
.El