From 66249c9d46e4d875200611f62e77cd67b620b12b Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Mon, 29 Feb 2016 20:35:15 +0400 Subject: [PATCH] nutools base: ajout de noerror(), noout(), noerr() --- lib/ulib/base | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/ulib/base b/lib/ulib/base index 5cca546..fc87827 100644 --- a/lib/ulib/base +++ b/lib/ulib/base @@ -2843,6 +2843,22 @@ function eerror_if() { fi } +function noerror() { +# lancer la commande "$@" et masquer son code de retour + [ $# -gt 0 ] || set : + "$@" || return 0 +} +function noout() { +# lancer la commande "$@" en supprimant sa sortie standard + [ $# -gt 0 ] || return 0 + "$@" >/dev/null +} +function noerr() { +# lancer la commande "$@" en supprimant sa sortie d'erreur + [ $# -gt 0 ] || return 0 + "$@" 2>/dev/null +} + TAB=$'\t' LATIN1=iso-8859-1 LATIN9=iso-8859-15