The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-25-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
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.