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:07:02 -0300 Sender: linux-admin-owner@vger.kernel.org Message-ID: <40832636.2040704@yahoo.com.br> References: <012b01c41782$a2344b60$020aa8c0@Scott> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <012b01c41782$a2344b60$020aa8c0@Scott> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: linux-admin@vger.kernel.org /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 > >