From 57db462c75a7ea1f71d349e12d23486a1daa21cf Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Tue, 13 Mar 2012 01:46:06 +0100 Subject: [PATCH] added neno --- neno/neno | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 neno/neno diff --git a/neno/neno b/neno/neno new file mode 100755 index 0000000..5a5c5e9 --- /dev/null +++ b/neno/neno @@ -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