
05-25-2007
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,369
|
|
Quote:
|
Originally Posted by aigles
You can do something like that:
Code:
#!/bin/sh
#Script adds multiple users into the Service manager
i=1
while [ $i -le 9000 ]
do
./insuser /WideSpan/config/vipclient.conf $i $i password 0 Org1 UserGroup1 'A' 1 "" "" root
i=`expr $i + 1`
done
|
Except that, instead of calling an external command 9,000 times, use the shell to do the arithmetic:
Code:
i=$(( $i + 1 ))
All *nix systems within the last 15 years have shells that perform integer arithmetic.
|