• Asked to answer
    + 1 comment

    As i understand, it seems there is empty value in the array after reading input. check if you have translated the input to remove '\r' before reading to array.

    debug using "bash -x script_name.sh" :)