The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #1 (permalink)  
Old 10-08-2008
cesarNZ cesarNZ is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 70
using array in ksh

hi all,
need help with putting names in an array, i have a few servers which i look up by doing a 'find . -name "*.pid' and the format of the output is like following :


./servername/myserver.pid

i was wondering how can i iterate through and store each name in one array

my code is as follows so far :

find ./ -name "*.pid" |
while read LINE;
do
serverArray[counter]=$($LINE | cut -d\/ -f2);

done


but this doesnt seem to work. any suggestions ??


thanks in advance.