Compare commits

..

No commits in common. "d8aa72989518f598ff470699a83f325bc04bd3f2" and "9cb9f7b69ddb36ef3a5d3dc4ab9490542b33535e" have entirely different histories.

3 changed files with 6 additions and 6 deletions

View file

@ -41,7 +41,7 @@ debug() {
local message="$*"
# si la variable $DEBUG n'est pas définie ou si sa valeur
# est différente de 1, on quite notre fonction.
[[ -z "$DEBUG" || $DEBUG -ne 1 ]] && return
[ -z "$DEBUG" || $DEBUG -ne 1 ] && return
[ -z "$message" ] && return
>&2 msg "DEBUG: $message"
}
@ -135,13 +135,13 @@ interprètera nos commandes échappées avec l'antislash**.
La couleur c'est bien, mais si on décide de rediriger une sortie (ou les deux)
de notre script dans un fichier voici son contenu ouvert dans `vim`:
```shell
```none
$ DEBUG=1 ./test.sh >error.txt 2>&1
$ vim error.txt
^[[34mDEBUG: We will display a message^[[0m
DEBUG: We will display a message
Test Message
^[[34mDEBUG: We will display an error^[[0m
^[[31mERROR: This is an error^[[0m
DEBUG: We will display an error
ERROR: This is an error
```
Nous allons justement régler ce problème dans le paragraphe suivant.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB