Article View: es.comp.os.linux.programacion
Article #8092Re: script shell while anidado
From: "Jesús M. NAVARRO"
Date: Thu, 12 Dec 2002 12:20
Date: Thu, 12 Dec 2002 12:20
57 lines
2268 bytes
2268 bytes
Hola, Alberto: Alberto Velasco 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; > > done > #fin alberto.sh > > > Sencillo verdad??? pues no me funciona... s�lo me hace el primer bucle, > hasta 10.95.1.255 y se para. �Cu�l es el problema? Espero que alguien me > pueda echar una mano. Gracias por anticipado. > Parece f�cil: f�jate en el estado de la variable VALB, y que s�lo haces "echo" en el bucle interior: pon un echo en el bucle exterior, y ver�s lo que pasa (pista) 10.95.1.1 10.95.1.2 10.95.1.3 (...) 10.95.1.254 10.95.1.255 10.95.2.255 10.95.3.255 10.95.4.255 10.95.5.255 (...) 10.95.254.255 10.95.255.255 FIN �Lo ves ahora? -- SALUD, Jes�s *** jesus_navarro@undominio.net ***
Technical Details
Message-ID:
<khbmc-5t1.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-mailReferences:
<3DF86DD3.F58230B4@tid.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 04:23:45 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 13:20:35 +0100 Lines: 58 Message-ID: <khbmc-5t1.ln1@mithrandir.intranet> References: <3DF86DD3.F58230B4@tid.es> NNTP-Posting-Host: 212.97.187.85 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1039695824 35632695 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: <3DF86DD3.F58230B4@tid.es>