UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 4.9 Built-in Commands (Bourne and Korn Shells)Chapter 4
The Bourne Shell and Korn Shell
Next: Reference: #
 

!

! pipeline

ksh93 only. Negate the sense of a pipeline. Returns an exit status of 0 if the pipeline exited nonzero, and an exit status of 1 if the pipeline exited zero. Typically used in if and while statements.

Example

This code prints a message if user jane is not logged on:

if ! who | grep jane > /dev/null
then
	echo jane is not currently logged on
fi


Previous: 4.9 Built-in Commands (Bourne and Korn Shells)UNIX in a Nutshell: System V EditionNext: Reference: #
4.9 Built-in Commands (Bourne and Korn Shells)Book IndexReference: #

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System