From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Scott@Charter" Subject: bash question Date: Wed, 31 Mar 2004 16:45:30 -0800 Sender: linux-admin-owner@vger.kernel.org Message-ID: <012b01c41782$a2344b60$020aa8c0@Scott> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0128_01C4173F.93A180B0" Return-path: List-Id: To: Linux-Admin-Group This is a multi-part message in MIME format. ------=_NextPart_000_0128_01C4173F.93A180B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0128_01C4173F.93A180B0 Content-Type: text/x-vcard; name="Scott Smallsreed.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Scott Smallsreed.vcf" BEGIN:VCARD VERSION:2.1 N:Smallsreed;Scott FN:Scott Smallsreed TEL;HOME;VOICE:775-849-8411 TEL;HOME;FAX:775-849-8412 ADR;HOME:;;3030 Chipmunk Dr.;Washoe Valley;Nevada;89704;US LABEL;HOME;ENCODING=3DQUOTED-PRINTABLE:3030 Chipmunk Dr.=3D0D=3D0AWashoe = Valley, Nevada 89704=3D0D=3D0AUS EMAIL;PREF;INTERNET:scott.smallsreed@mindspring.com REV:20040401T004530Z END:VCARD ------=_NextPart_000_0128_01C4173F.93A180B0--