[mythtv-users] Quick script question

Nick Morrott knowledgejunkie at gmail.com
Wed Aug 15 19:48:27 UTC 2007


On 15/08/07, David George <david at thegeorges.us> wrote:
> On 08/15/2007 01:31 PM, Sarah Katherine Hayes wrote:
> > at the
> > momment I'm figuring out how to do an almighty do ... while loop in
> > bash.  I'm rather rusty and only ever did C.
> >
>
> Here is a quick-and-dirty example of a while loop:
>
> #/bin/bash
> let i=0
> while [[ $i -lt 9 ]]; do echo $i; ((i+=1)); done
>
> If you always want the loop to run at least once you can use until:
>
> #/bin/bash
> let i=0
> until [[ $i -eq 9 ]]; do echo $i; ((i+=1)); done

Here's a link to my favourite BASH programming resource:

http://www.tldp.org/LDP/abs/html/

-- 
Nick

MythTV Official wiki:
http://mythtv.org/wiki/
MythTV users list archive:
http://www.gossamer-threads.com/lists/mythtv/users

"An investment in knowledge always pays the best interest." - Benjamin Franklin


More information about the mythtv-users mailing list