[sllug-members]: Command to Execute command continuously

Nelson H. F. Beebe beebe at math.utah.edu
Wed Jun 21 05:31:15 MDT 2006


"Randy Clements" <handyrandyrc at gmail.com> asks about running a 
script repeatedly to test a server.

This csh (or tcsh) command does it nicely:

	repeat 99999999 your-command-here

In loop form, it looks like this:

	while (1)
		your-command-here
	end

Alternatively, use a loop in sh, bash, ksh, or zsh:

	while true ; do your-command-here; done

Interrupt them with Ctl-C or a kill single when they have done enough.

You can put a sleep command in your script to introduce delays if you
need them.  The normal sleep command takes an argument in seconds, but
the GNU coreutils takes a floating-point value, allowing delays of
less than a second.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the sllug-members mailing list