Somebody smart enough with sed suggested me a solution, but apparently Im not saying everything that it is:
He proposed:
Code:
for f in /1000/files/*; do bname=${f##*/}; path=$(sed -n '/^Path=/s///p' "/1000/info/$bname.trashinfo") && [[ $path ]] || continue; mv "$f" "$path"; done
All the files and their original locations are in an external HDD named "Volume-1". /media/Volume-1 acts as my home directory:
/media/Volume-1/1000/expunged
/media/Volume-1/1000/files
/media/Volume-1/1000/info
and the files are to be restored to their respective subdirectories in:
/media/Volume-1/Music
that command, executed from /media/Volume-1 always returns:
Code:
sed: can't read /1000/info/*.trashinfo: No such file or directory
Is there any information I am not giving you?
The names of the files do have empty spaces, is that relevant?
Bookmarks