06-08-20121
This commit is contained in:
@@ -119,7 +119,7 @@ $ usermod -G "" <username>
|
||||
|
||||
|
||||
|
||||
### Code de sortie:
|
||||
### Code de sortie (code de retour):
|
||||
|
||||
Chaque commande renvoie un *code de sortie* (quelque fois nommé *état de retour* ).
|
||||
|
||||
@@ -136,6 +136,7 @@ $ hostname
|
||||
silverbook.home
|
||||
$ echo $?
|
||||
0
|
||||
|
||||
$ hostnam
|
||||
-bash: hostnam: command not found
|
||||
$ echo $?
|
||||
@@ -149,3 +150,18 @@ bruno@SilverBook:~/.kymsu/plugins.d$ if [ $? -eq 0 ]; then echo "ok"; else echo
|
||||
ok
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ pip3 install -U "pip"
|
||||
ret=$?
|
||||
|
||||
# pas d'update: ret=0
|
||||
[ $ret -eq 0 ] && echo -e "No update available !"
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
echo -e "No update available !"
|
||||
fi
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user