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 -->
  #2 (permalink)  
Old 02-23-2005
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,802
Try an array:

Code:
#!/bin/ksh

ROUTE_MAX_NO_OF_ENTRY=10

# make an array with 11 (0 thru 10) elements use the last ten 
# elements

set -A ip_addr \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0' \
 '0.0.0.0'
 
# print the array 

integer i=0
while (( i <=  ${#ip_addr[*]} ))
do 
    print "ip_addr[$i]= ${ip_addr[i]}"
    let i=i+1
done