Re: Script pour démarrer un daemon par défaut : un bug ?
Roland Mas <[email protected]> Fri, 22 Apr 2016 20:48:25 +0200
| Newsgroups | gmane.linux.debian.devel.french |
|---|---|
| Message-ID | <[email protected]> |
Laurent COOPER, 2016-04-22 16:43:15 +0200 : [...] > 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; > 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; > esac > ;; > > en fait, si VERBOSE vaut no (c'est la cas par défaut), le > [ "$VERBOSE" != no ] retourne 1. Ou alors, tu mets [ "$VERBOSE" = no ] || log_end_msg 0. Le log_end_msg sera exécuté dans les mêmes cas, mais s'il n'est pas exécuté tu gardes un 0 comme code de sortie du pipeline donc ça marche même avec set -e. Roland. -- Roland Mas Indépendant en informatique libre -- Free software freelance http://www.gnurandal.com/