LinuxCommandLibrary

ifne

Run a command depending on the emptyness of `stdin`.

TLDR

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

$ ifne [command options ...]
copy


Run the specified command if and only if stdin is empty, otherwise pass stdin to stdout
$ ifne -n [command options ...]
copy

Copied to clipboard