test

Official Description

Evaluates conditional expressions.

Syntax

test [expression]

Options

None

Oddities

It's the same as [.

Example

$
$ test -x buzz               # Is buzz executable?
$ print $?
0                            # Yup
$
$ test -b buzz               # Is buzz a block special file?
$ print $?
1                            # Nope
$
				

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.