Interprétation des reponses par shell
Résolu/Fermé
A voir également:
- Interprétation des reponses par shell
- Classic shell windows 11 - Télécharger - Personnalisation
- Shell startup windows 10 - Guide
- La blague des trois nains réponse ✓ - Forum Loisirs / Divertissements
- Ssh secure shell download - Télécharger - Divers Web & Internet
- Do while shell ✓ - Forum Shell
3 réponses
jipicy
Messages postés
40842
Date d'inscription
jeudi 28 août 2003
Statut
Modérateur
Dernière intervention
10 août 2020
4 897
21 déc. 2007 à 15:44
21 déc. 2007 à 15:44
Salut,
Si la sortie des commandes SNMP est envoyée dans un fichier :
Si la sortie des commandes SNMP est envoyée dans un fichier :
compteurUP=$(grep -c "up$" fichier);-))
dubcek
Messages postés
18767
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
5 mars 2025
5 628
21 déc. 2007 à 15:49
21 déc. 2007 à 15:49
Par ex. avec awk:
awk 'BEGIN {up=0;down=0} ; $NF ~ /up/ {up++} ; $NF ~ /down/ {down++} ; END {print "UP " up " DOWN " down }'
awk 'BEGIN {up=0;down=0} ; $NF ~ /up/ {up++} ; $NF ~ /down/ {down++} ; END {print "UP " up " DOWN " down }'