Re: [SLUG] Scripting question

From: Ian C. Blenke (icblenke@nks.net)
Date: Thu Sep 05 2002 - 15:53:46 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?
> Smitty

#!/bin/sh
n=10
while [ $n != 0 ]; do
 echo n=$n
 n=`echo $n - 1 | bc`
 command;
done
anothercommand;



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:57:09 EDT