ifne - Man Page
Run command if the standard input is not empty
Examples (TL;DR)
- Run the specified command if and only if
stdin
is not empty:ifne command options ...
- Run the specified command if and only if
stdin
is empty, otherwise passstdin
tostdout
:ifne -n command options ...
Synopsis
ifne [-n] command
Description
ifne runs the following command if and only if the standard input is not empty.
Options
- -n
Reverse operation. Run the command if the standard input is empty.
Note that if the standard input is not empty, it is passed through ifne in this case.
Example
find . -name core | ifne mail -E 'set escape' -s "Core files found" root
Author
Copyright 2008 by Javier Merino <cibervicho@gmail.com>
Licensed under the GNU GPL
Info
2008-05-01 moreutils