linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bash question
@ 2004-04-01  0:45 Scott@Charter
  2004-04-01  7:03 ` Luca Ferrari
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Scott@Charter @ 2004-04-01  0:45 UTC (permalink / raw)
  To: Linux-Admin-Group

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Scott Smallsreed.vcf --]
[-- Type: text/x-vcard; name="Scott Smallsreed.vcf", Size: 366 bytes --]

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=QUOTED-PRINTABLE:3030 Chipmunk Dr.=0D=0AWashoe Valley, Nevada 89704=0D=0AUS
EMAIL;PREF;INTERNET:scott.smallsreed@mindspring.com
REV:20040401T004530Z
END:VCARD

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-04-19  1:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-01  0:45 bash question Scott@Charter
2004-04-01  7:03 ` Luca Ferrari
2004-04-01 14:58   ` Jeff Largent
2004-04-01 19:46     ` Chuck Harding
2004-04-01 22:53       ` Glynn Clements
2004-04-02  9:32         ` urgrue
2004-04-03 18:19         ` Nico Schottelius
2004-04-19  1:07 ` Joao Victor A. Di Stasi
2004-04-19  1:14   ` Joao Victor A. Di Stasi
2004-04-19  1:42 ` Stephen Samuel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).