🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #8095

Re: script shell while anidado

#8095
From: "Jesús M. NAVARRO"
Date: Thu, 12 Dec 2002 13:45
47 lines
2347 bytes
Hola, J.A.:

J.A. Gutierrez wrote:
> Alberto Velasco <velasco@tid.es> wrote:
> : Hola, me estoy volviendo loco para hacer un simple while anidado:
> 
> : #!/bin/bash
> : #alberto.sh
> : #Script para capturar todas las MACs de la empresa con su respectiva IP.
> 
> : echo "Buscando IPs"
> : VAL=1
> : VALB=1
> : IP="10.95."
> : while [ $VAL -lt 255 ]
> : do
> :         while [ $VALB -lt 255 ]
> :         do
> :                 echo arp $IP$VAL"."$VALB
> :                 let VALB=VALB+1
> :         done
> :         let VAL=VAL+1;
> 
> 	let VALB=1
> 
> : done
> : #fin alberto.sh
> 
> 	por cierto, no se si tiene mucho sentido buscar la direccion
> 	MAC de *.255...

En realidad no parece que lo haga (*primero* hace la arprquest y despu�s 
  incrementa la variable; puesto que el bucle se verifica mientras la 
variable es *menor* que 255, 255 no deber�a ser probado).

> 	Ademas, antes de hacer un arp a una IP es conveniente hacerle
> 	un ping para que la cache de arp este actualizada.
> 

En realidad, para todo el asunto hubiera utilizado nmap, que ofrece 
mucha m�s flexibilidad.
-- 
SALUD,
Jes�s
***
jesus_navarro@undominio.net
***
Technical Details
Message-ID: <5ggmc-3f3.ln1@mithrandir.intranet>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!212.97.187.85!not-for-mail
References: <3DF86DD3.F58230B4@tid.es> <ata3rr$kkv$1@news.unizar.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,8a7f2b62fc8f7737
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-12-12 06:12:14 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!212.97.187.85!not-for-mail
From: "Jesús M. NAVARRO"
 <jesus_navarro@undominio.net>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: script shell while anidado
Date: Thu, 12 Dec 2002 14:45:07 +0100
Lines: 48
Message-ID: <5ggmc-3f3.ln1@mithrandir.intranet>
References: <3DF86DD3.F58230B4@tid.es> <ata3rr$kkv$1@news.unizar.es>
NNTP-Posting-Host: 212.97.187.85
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1039702332 33192629 212.97.187.85 (16 [173178])
X-Orig-Path: mithrandir.intranet!news
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20021208 Debian/1.2.1-2
X-Accept-Language: es-es, es
In-Reply-To: <ata3rr$kkv$1@news.unizar.es>