Exploiter fichier texte
Résolu
vindicien
Messages postés
131
Date d'inscription
Statut
Membre
Dernière intervention
-
vindicien Messages postés 131 Date d'inscription Statut Membre Dernière intervention -
vindicien Messages postés 131 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Exploiter fichier texte
- Fichier bin - Guide
- Fichier epub - Guide
- Fichier rar - Guide
- Comment réduire la taille d'un fichier - Guide
- Fichier .dat - Guide
2 réponses
Salut,
Plutôt tester le code retour ($?), non ?
Plutôt tester le code retour ($?), non ?
[tmpfs]$ cat foo.sh #! /bin/sh #set -xv ping -c 1 -q $1 >/dev/null if [ "$?" != "0" ] then echo "Ping sur $1 pas bon" fi [tmpfs]$ ./foo.sh 192.168.10.20 # ma passerelle [tmpfs]$ ./foo.sh 192.168.10.21 # machine inexistante Ping sur 192.168.10.21 pas bon [tmpfs]$ ./foo.sh commentcamarche.net# CCM [tmpfs]$ ./foo.sh commentcamarche.en# CCM inexistant ping: unknown host commentcamarche.en Ping sur commentcamarche.en pas bon [tmpfs]$ ./foo.sh 192.168.10.199 # ma propre machine [tmpfs]$ ./foo.sh 192.168.10.190 # machine inexistante Ping sur 192.168.10.190 pas bon [tmpfs]$;-))
Bien joué ça me simplifie encore plus la vie !!!!!
Merci beaucoup !!
Vind'