| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
|
| 3 |
<!-- |
| 4 |
|
| 5 |
Copyright 2008 Javier Merino <[email protected]> |
| 6 |
|
| 7 |
This program is free software; you can redistribute it and/or modify it |
| 8 |
under the terms of the GNU General Public License as published by the |
| 9 |
Free Software Foundation; either version 2 of the License, or (at your |
| 10 |
option) any later version. |
| 11 |
|
| 12 |
This program is distributed in the hope that it will be useful, but |
| 13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
| 15 |
Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License along |
| 18 |
with this program; if not, write to the Free Software Foundation, Inc., |
| 19 |
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
|
| 21 |
--> |
| 22 |
|
| 23 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" |
| 24 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" |
| 25 |
[]> |
| 26 |
|
| 27 |
<refentry> |
| 28 |
<refentryinfo> |
| 29 |
<address> |
| 30 |
<email>[email protected]</email> |
| 31 |
</address> |
| 32 |
<author> |
| 33 |
<firstname>Javier</firstname> |
| 34 |
<surname>Merino</surname> |
| 35 |
</author> |
| 36 |
<date>2008-05-01</date> |
| 37 |
</refentryinfo> |
| 38 |
|
| 39 |
<refmeta> |
| 40 |
<refentrytitle>ifne</refentrytitle> |
| 41 |
<manvolnum>1</manvolnum> |
| 42 |
<refmiscinfo class="manual">moreutils</refmiscinfo> |
| 43 |
<refmiscinfo class="source">moreutils</refmiscinfo> |
| 44 |
</refmeta> |
| 45 |
|
| 46 |
<refnamediv> |
| 47 |
<refname>ifne</refname> |
| 48 |
<refpurpose>Run command if the standard input is not empty</refpurpose> |
| 49 |
</refnamediv> |
| 50 |
|
| 51 |
<refsynopsisdiv> |
| 52 |
<cmdsynopsis> |
| 53 |
<command>ifne [-n] command</command> |
| 54 |
</cmdsynopsis> |
| 55 |
</refsynopsisdiv> |
| 56 |
|
| 57 |
<refsect1> |
| 58 |
<title>DESCRIPTION</title> |
| 59 |
|
| 60 |
<para><command>ifne</command> runs the following command if and only if |
| 61 |
the standard input is not empty.</para> |
| 62 |
</refsect1> |
| 63 |
|
| 64 |
<refsect1> |
| 65 |
<title>OPTIONS</title> |
| 66 |
|
| 67 |
<variablelist> |
| 68 |
<varlistentry> |
| 69 |
<term><option>-n</option></term> |
| 70 |
<listitem> |
| 71 |
<para>Reverse operation. Run the command if the standard input is empty.</para> |
| 72 |
<para>Note that if the standard input is not empty, it is passed through ifne |
| 73 |
in this case.</para> |
| 74 |
</listitem> |
| 75 |
</varlistentry> |
| 76 |
</variablelist> |
| 77 |
</refsect1> |
| 78 |
|
| 79 |
<refsect1> |
| 80 |
<title>EXAMPLE</title> |
| 81 |
<cmdsynopsis> |
| 82 |
<command>find . -name core | ifne mail -E 'set escape' -s "Core files found" root</command> |
| 83 |
</cmdsynopsis> |
| 84 |
</refsect1> |
| 85 |
|
| 86 |
<refsect1> |
| 87 |
<title>AUTHOR</title> |
| 88 |
|
| 89 |
<para>Copyright 2008 by Javier Merino <[email protected]></para> |
| 90 |
<para>Licensed under the GNU GPL</para> |
| 91 |
</refsect1> |
| 92 |
|
| 93 |
</refentry> |