nutools base: ajout de noerror(), noout(), noerr()

This commit is contained in:
Jephte CLAIN 2016-02-29 20:35:15 +04:00
parent db76488e16
commit 66249c9d46
1 changed files with 16 additions and 0 deletions

View File

@ -2843,6 +2843,22 @@ function eerror_if() {
fi 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' TAB=$'\t'
LATIN1=iso-8859-1 LATIN1=iso-8859-1
LATIN9=iso-8859-15 LATIN9=iso-8859-15