HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

ifne — Run a command depending on the emptiness of `stdin`. More information: <https://manned.org/ifne>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandruncliemptinessdependingifne

Problem

How to use the ifne command: Run a command depending on the emptiness of stdin. More information: <https://manned.org/ifne>.

Solution

ifne — Run a command depending on the emptiness of stdin. More information: <https://manned.org/ifne>.

Run the specified command if and only if stdin is not empty:
ifne {{command}} {{command_options}}


Run the specified command if and only if stdin is empty, otherwise pass stdin to stdout:
ifne -n {{command}} {{command_options}}

Code Snippets

Run the specified command if and only if `stdin` is not empty

ifne {{command}} {{command_options}}

Run the specified command if and only if `stdin` is empty, otherwise pass `stdin` to `stdout`

ifne -n {{command}} {{command_options}}

Context

tldr-pages: common/ifne

Revisions (0)

No revisions yet.