2

cmdline> ls -la /.myScript.sh

   set index=0
    set usrlist[index]="null" 


        while read line
        do

        #Total lines read
        z=`echo $line| wc -l`
        lines=`expr $lines + $z`    

        # 2) #total unique user
        linesED=`echo $line | sed 's/[0-9]//g'`
        linesEDA=`echo ${linesED:10}` 
        userr=`echo $linesEDA | awk '{print $1}'`  

        for i in z
        do
            usrlist[i]=$userr
        done
            index=`expr $index + $i`
            echo ${usrlist[index]}# prints out data correctly but with 
                                  #error expr:non-integer argument 
        done
 echo ${usrlist[index]}#here blank output only

I want to print out all the memebers of array at end, without error

1
0

You need to introduce a file for done of while such as :

done < myfile.txt
1
  • thank you , but I managed to do it in another way..thanks for the help though May 3 '15 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.