incorrect array values

I have a file with 2 lines and 3 filelds

-bash-3.00$ cat del_old_files.cfg
$DBA_WORK_DIR *sybdba* 30
$DBA_LOG_DIR *sybdba* 30

I have tried to set up arrays for each field (bash shell)

declare -a dirArray=`cut -d' ' -f1 < del_old_files.cfg`
declare -a nameArray=`cut -d' ' -f2 < del_old_files.cfg`
declare -a daysArray=`cut -d' ' -f3 < del_old_files.cfg`

when I query the array I get

-bash-3.00$ echo ${dirArray[0]}; echo ${nameArray[0]}; echo ${daysArray[0]}
$DBA_WORK_DIR $DBA_LOG_DIR
*sybdba* *sybdba*
30 30
-bash-3.00$ echo ${dirArray[1]}; echo ${nameArray[1]}; echo ${daysArray[1]}

logically I would expect the [0] and [1] queries to return only 1 value

Where did I go wrong?

what do you want to do actually?

I want to be able to build a find command to delete files older than the number

find `echo ${dirArrary[0]}` -name "`echo ${nameArray[0]}`" -mtime +`echo{daysArray[0]}` -exec rm {}\;

#!/bin/sh
while read line 
do
    set -- $line
    find $1 -name \"$2\" -mtime +"$3"
done < file

this fails as it is not converting the variables $DBA_WORK_DIR and $DBA_LOG_DIR

-bash-3.00$ while read line ; do set -- $line; find $1 -name \"$2\" -mtime +"$3"; done < del_old_files.cfg
find: stat() error $DBA_WORK_DIR: No such file or directory
find: stat() error $DBA_LOG_DIR: No such file or directory

yet the find statement works outside of the while statement

find $DBA_WORK_DIR -name "*sybdba*" -mtime +30
produces the expected list of files

this fails as it is not converting the variables $DBA_WORK_DIR and $DBA_LOG_DIR

-bash-3.00$ while read line ; do set -- $line; find $1 -name \"$2\" -mtime +"$3"; done < del_old_files.cfg
find: stat() error $DBA_WORK_DIR: No such file or directory
find: stat() error $DBA_LOG_DIR: No such file or directory

yet the find statement works outside of the while statement

find $DBA_WORK_DIR -name "*sybdba*" -mtime +30
produces the expected list of files

output with set -x

-bash-3.00$ ./jjh
+ read line
+ set -- '$DBA_WORK_DIR' '*sybdba*' 30
+ find '$DBA_WORK_DIR' -name '"*sybdba*"' -mtime +30
find: stat() error $DBA_WORK_DIR: No such file or directory
+ read line
+ set -- '$DBA_LOG_DIR' '*sybdba*' 30
+ find '$DBA_LOG_DIR' -name '"*sybdba*"' -mtime +30
find: stat() error $DBA_LOG_DIR: No such file or directory
+ read line
-bash-3.00$

so how do I get rid of the single quotes?

How did you create your del_old_files.cfg? If you can, put in a real path instead of $DBA_WORK_DIR. Otherwise, you have to define these variables somewhere in the script, so that they contain path values