[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Looping a script
- From: rpjday <rpjday mindspring com>
- To: <redhat-list redhat com>
- Subject: Re: Looping a script
- Date: Sun, 18 Feb 2001 18:02:31 -0500 (EST)
On Sun, 18 Feb 2001, Vidiot wrote:
> > What's the best/safest way to loop a script over and over again?
> >
> > All it does is call a different program with arguments (it plays mp3
> >files) and I want it to loop and start again when it reaches the end.
> >
> > #!/bin/sh
> > amp -p "file one.mp3"
> > amp -p "file two.mp3"
> > ...
>
> You can use a while loop, using a variable that is always true. It'll never
> end that way :-)
the best way is to just do:
while true ; do
...
done
the word "true" is a shell built-in which always returns a logical
value of true for the purposes of the loop.
rday
--
Robert P. J. Day
Eno River Technologies, Durham NC
Unix, Linux and Open Source training
"This is Microsoft technical support. How may I misinform you?"
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]