Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/bin/rc/waitloop

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

# Retry a command with a minimum delay. Avoid chewing up
# the machine on commands with transient failures.

if (test $#* -lt 2) {
	echo 'usage: ' $0 ' seconds command...' >[1=2]
	exit usage
}

sec=$1
shift

while () {
	$* &
	sleep $sec
	wait
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.