OH, I'm stuck on Bash 3.2
This is what the file contents might look like:
Code:
cat index.txt
/source/dir/file /destination/dir/newfile
/source/dir/file1 /destination/dir/newfile1
/source/dir/file2 /destination/dir/newfile2
If I'm saying this correctly, I'm trying to save each row of that index.txt file as an associative array (I think?) so then I could loop thru the index.txt file (array), but "move" the elements from source_file to destination_file for each iteration of the loop. There's no white space in the file names or path, only between the source and destinations themselves.
I thought it might work something like this with the move command once I get the array's elements working right.
Code:
declare -A Array=$(cat index.txt)
for Line in ${Array[@]}
do
mv ${Line[0]} ${Line[1]}
done
I know this is mucked up.
I know I can read in the file with read, but I suck at that too.