June 2006
Intermediate to advanced
64 pages
2h 42m
English
!
! pipelineNegate 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.
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
fiRead now
Unlock full access