added neno
This commit is contained in:
parent
c223c7dac1
commit
57db462c75
22
neno/neno
Executable file
22
neno/neno
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Usage:
|
||||
# neno command1 \; command2
|
||||
#
|
||||
# neno (no error no output) runs a composed command.
|
||||
# If the command returns true output will be ignored
|
||||
# Else: the output will be printed on stdout and stderr
|
||||
#
|
||||
# EXAMPLE: neno command1 \; command2
|
||||
# If command2 returns true the output from both commands will be ignored
|
||||
# Else: the output will be printed on stdout and stderr
|
||||
|
||||
TMP=$(mktemp -d /tmp/no-error.XXXXX)
|
||||
if eval $* 2>$TMP/stderr >$TMP/stdout ; then
|
||||
# skip
|
||||
true
|
||||
else
|
||||
cat $TMP/stderr >&2
|
||||
cat $TMP/stdout
|
||||
fi
|
||||
rm -rf $TMP
|
Loading…
Reference in a new issue