[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script bash



Le Thu, 9 Jun 2011 14:02:30 +0200,
Nahliel Steinberg <nahliel.steinberg@gmail.com> a écrit :

> >Bonjour,
> >
> >admettons que dans ton fichier tu aies une adresse ip par ligne
> >
> >#!/bin/bash
> >
> >FICHIP="monfichier.txt"
> >
> >while read a
> >do
> >    snmpget -c "public" $a
> >done < $FICHIP
> 
> Merci ça marche, je complique :
> 
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 12990
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 17265
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 7294
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 19067
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 7071
> iso.3.6.1.2.1.43.10.2.1.4.1.1 = Counter32: 4038
> 
> Voici un exemple de retour de la commande. je voudrai additionner les
> valeurs qui sont remontées par la commande et afficher le total.
> 
> ça vous semble possible ?
> 

shalom,

	voici la réponse d'un pauvre goy ignorant :

	http://bash.cyberciti.biz/shell-math/sum-of-two-numbers-2/

	slt
	bernard


Reply to: