I have a config file containing filename without extension each line.
//load.config
aa
bb
I read them to array and build the full path for each file.
configFile="C:/xxxx/load.config"
myarray=()
while read -r line || [ -n "$line" ]; do
myarray+=("$line")
echo "$line"
done < "$configFile"
folder="C:/project/test/"
for((i = 0; i < ${#myarray[@]}; ++i))
do
file=${myarray[$i]}
echo "folder="$folder
echo "file="$file
file_path=$folder$file".xml"
echo "$file_path"
echo "next..."
done
Below is the result:
aa
bb
folder=C:/project/test/
file=aa
.xmlroject/test/aa
next...
folder=C:/project/test/
file=bb
C:/project/test/bb.xml
next...
Why does it give me this??
.xmlroject/test/aa