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

Re: need help on shell programming



On Thu, Feb 26, 2009 at 03:56:54PM -0600, Kumar Appaiah wrote:
> On Thu, Feb 26, 2009 at 3:54 PM, Long Wind wrote:
> > I want a script.
> > The script run a command, wait one minute,
> > then run the command again, wait one minute again
> > ... again and again ...
> 
>  while [[ 1 < 2 ]]; do echo Hello; sleep 60;done

Not only bashism, but also not as readable.

> 
> Replace "echo Hello" with your command.


#!/bin/sh
while true
do
  your command
  sleep 60
done

-- 
Tzafrir Cohen         | tzafrir@jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir@cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend


Reply to: