somme corrections thanks to Florian
This commit is contained in:
parent
9cb9f7b69d
commit
b4550c8951
1 changed files with 5 additions and 5 deletions
|
@ -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`:
|
||||
|
||||
```none
|
||||
```shell
|
||||
$ DEBUG=1 ./test.sh >error.txt 2>&1
|
||||
$ vim error.txt
|
||||
[34mDEBUG: We will display a message[0m
|
||||
^[[34mDEBUG: We will display a message^[[0m
|
||||
Test Message
|
||||
[34mDEBUG: We will display an error[0m
|
||||
[31mERROR: This is an error[0m
|
||||
^[[34mDEBUG: We will display an error^[[0m
|
||||
^[[31mERROR: This is an error^[[0m
|
||||
```
|
||||
|
||||
Nous allons justement régler ce problème dans le paragraphe suivant.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue