Reading Of Array Element in Unix

Hi,

I am using the following command to initialize and array

# arr[i]=ffffff00
# echo $arr
ffffff00
my requirement is i want to fetch the one by one character from array.
I don't know how to fetch one by one charcter from array.

Please i need an help.

Thank you very much
Ravi R N

echo ${arr}|perl -ne 'print join("\n",split(//,$_));'

and feed it into a read (or similar)

You have only initialized one element of the array. You might as well just use a scalar variable:

var=ffffff00

To get one character at a time from the variable:

var=ffffff00
while [ -n "$var" ]
do
  temp=${var#?}
  letter=${var%"$temp"}
  printf "%s\n" "$letter"
  var=$temp
done