Hello and thanks for visiting my blog!
Here you'll find some of the code I write, some of the technologies I use and like and some things I think it's important to remember.
Have fun! :)
Thursday, March 3, 2011
Execute a shell command a given number of time.
A small utility to execute a shell command a given number of time:
#! /bin/bash#Execute the command a given number of timesEXPECTED_ARGS=2
E_BADARGS=65
if[$# < $EXPECTED_ARGS]thenecho"Usage: `basename $0` N command"exit$E_BADARGSfifor((n=0; n<$1; n++))do${@:2}done
No comments:
Post a Comment