Re: [SLUG] Scripting question

From: R P Herrold (herrold@owlriver.com)
Date: Thu Sep 05 2002 - 18:18:47 EDT


On Thu, 2002-09-05 at 15:04, Smitty wrote:
> What would the syntax be if I wanted to repeat a command n times?
> And if after repeating the command n times, follow it by another command?

#!/bin/sh
for i in 1 2 3 4 5 ; do
        [ "x$1" != "x" ] && . $1
done
[ "x$2" != "x" ] && . $2

------------------------------

will execute the command in arg 1, five times, followed by
the command in arg 2 -- if either arg is null, no error

untested, but should work

-- Russ Herrold



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:58:44 EDT