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

Bug#180107: narrow down hacks



On Sun, Oct 10, 2004 at 03:56:20PM +0200, Tormod Volden wrote:
> while true ; do xscreensaver-command -next ; sleep 3 ; ps lax > 
> /var/tmp/lastscreensaverhack ; sleep 57 ; done

As an aside...

I find it's better to write "infinite" loops in the shell such that they
terminate when the command of interest fails:

while xscreensaver-command -next; do
  sleep 3
  ps lax >/var/tmp/lastscreesaverhack
  sleep 57
done

Of course, if the xscreensaver command never actually fails, this makes no
difference.

In general, though, I eschew "while true" and "while :".

-- 
G. Branden Robinson                |    No executive devotes much effort to
Debian GNU/Linux                   |    proving himself wrong.
branden@debian.org                 |    -- Laurence J. Peter
http://people.debian.org/~branden/ |

Attachment: signature.asc
Description: Digital signature


Reply to: