I have this piece of code:
file="/dir/conf/file.config"
# while loop
while IFS='|' read -r source target filecount
do
echo "source: ${source}"
echo "target: ${target}"
echo "filecount: ${filecount}"
echo "======================="
done < "$file"
the job of this code is to read this config file:
Source1|Target1|1
Source2|Target2|2
Source3|Target3|4
Source4|Target4|3
Source5|Target5|6
The read stops at Source4 and skips the last line. How do I make sure it reads ALL the lines? Thanks!