Hi,
I am having problems getting a string (DB query results) delimited by a space in to an array in BASH.
ARRAY=$STRING results in all the SQL results going in to the arrays first element.
Trying to do a lop like ;
brings an error for the cut command.
Ideas ? Must be an easy way but at 1:20am here my brain and eyes are fried .
Cheers
RB
I am having problems getting a string (DB query results) delimited by a space in to an array in BASH.
ARRAY=$STRING results in all the SQL results going in to the arrays first element.
Trying to do a lop like ;
while [ "$INDEX" -lt "$ELEMENT_COUNT" ]
do
SQL_RETURN[$INDEX]=`echo $ELEMENTS | cut -d' ' -f$(INDEX)`
exit 0
done
brings an error for the cut command.
Ideas ? Must be an easy way but at 1:20am here my brain and eyes are fried .
Cheers
RB