[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: simple bash loop problem ...



Google for 'bash loops'

http://www.google.com.au/search?q=bash+loops&ie=UTF-8&oe=UTF-8&hl=en&meta=


the first link is
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html

Matt


--


> -----Original Message-----
> From: David selby [mailto:debian@pusspaws.net] 
> Sent: Sunday, 29 June 2003 7:15 PM
> To: Debian list
> Subject: simple bash loop problem ...
> 
> 
> Hello,
> 
> I am writing bash a bash & sed script, it has been going suprisingly 
> well. I need a loop to count 9 times & the variable n to the count ..
> 
> for n=1 to 9
> ....
> next
> 
> kind of thing, but this is not BASIC !!
> 
> My best guess is
> 
> declare -i n=1
> while [ $n < 9 ]; do
> .....
> n=$((n+=1))
> done
> 
> All i get is ...
> 
> web@debian:/usr/local/myfiles/dave/websites/kcards$ ./gensite
> ./gensite: 9: No such file or directory
> 
> I have defined it as an integer, used the less than operator for 
> integers, ... errr ... I know its something stupid but I 
> can't crack it ....
> 
> Dave
> 
> PS is there a more ellagent way to do a counted loop as well as a way 
> that works ?
>  
> 
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact 
> listmaster@lists.debian.org
> 




Reply to: