Quote:
Originally Posted by rakeshawasthi
You can not do like this... $ should not come on the left side.
This will work...
Code:
Sam=`echo $line |awk -F" " {print $5}' |awk -F":" '{print $2}'`
|
-----------
Hi thanks.. the code you gave worked.
but further while accessing the array Sam. i am having some issues.
1: When i echo ${Sam[$2]} rather than giving the 2nd element it prints all of them
2: for (( i = 0 ; i < ${#Sam[@]} ; i++ ))
do
echo ${Sam[$i]}
done
its throwing an error
Test[16]: syntax error at line 17 : `((' unexpected
can you please tell how to go about accessing the array..