I have a file in custom_target.config. I have a shell script that is going to read through this config file. The config file is split up by the name of the file and the target directory I am trying to move it to. I was wondering what the best way is to split line in the file and start moving the files to the respective locations.
EXAMPLE_FILE /home/user/example
EXAMPLE_FILE_1 /home/user/example
EXAMPLE_FILE_1 /home/user/example/subfolder
Attemp so far:
while IFS='' read -r line || [[ -n "$line" ]]; do
for element in $line
do
echo $element
done
#echo "Text read from file: $line"
done < "$1"
EXAMPLE_FILEto/home/user/example? Trywhile IFS= read -r file dir; do echo mv "${file}" "${dir}"; done < "$1" and removeecho` when it is what you want.|| [[ -n $line ]].