From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joao Victor A. Di Stasi" Subject: Re: bash question Date: Sun, 18 Apr 2004 22:14:19 -0300 Sender: linux-admin-owner@vger.kernel.org Message-ID: <408327EB.1090801@yahoo.com.br> References: <012b01c41782$a2344b60$020aa8c0@Scott> <40832636.2040704@yahoo.com.br> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40832636.2040704@yahoo.com.br> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Cc: linux-admin@vger.kernel.org Ooops! must be a bash script... sorry Joao Victor A. Di Stasi wrote: > /usr/bin/seq 1 2 10 > works fine > > Scott@Charter wrote: > >> I can't get this bash script to work. It's suppose to print all odd >> numbers >> from 1 to 10. >> >> #!/usr/bin/bash >> >> LIMIT=10 >> a=1 >> >> while [ "$a" -le $LIMIT ] >> do >> if [ "$a" -eq $(1 3 5 7 9) ] <---------Something not right here. >> then >> echo -n "$a " >> fi >> >> echo >> >> let "a+=1" >> done >> echo; echo >> exit 0 >> >> >> Can anyone figure out what I am doing wrong? Can I also see the same >> thing >> written in Perl? >> >> Thanks for your help. >> >> >> >> Scott D. Smallsreed >> 3030 Chipmunk Dr. >> Washoe Valley, NV 89704 >> 775.849.8411 Hm >> 775.849.8412 Fax >> 775.722.7773 Cell >> >> > > - > To unsubscribe from this list: send the line "unsubscribe linux-admin" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >