theniteowl
Programmer
I am trying to figure out how to move files based on a plain text file listing one filename per line.
I have found some examples online but none seem to work for me.
I am using Solaris Unix so not all command options are the same.
The most recent attempt that came closest is:
But this comes back with the message "cannot access filename.ext" for each line in the text file.
The files.txt file is in the same folder as the files to be moved and that is the folder I am executing from. It does not seem to be a permissions issue as I tried it with superuser privledges as well.
I tried specifying the path to the file in files.txt as well but with the same result.
I have tried a number of xarg commands as well with no success.
Anyone have any ideas?
Thanks.
At my age I still learn something new every day, but I forget two others.
I have found some examples online but none seem to work for me.
I am using Solaris Unix so not all command options are the same.
The most recent attempt that came closest is:
Code:
cat files.txt | while read line; do mv "$line" /ops/data/obsolete ; done
But this comes back with the message "cannot access filename.ext" for each line in the text file.
The files.txt file is in the same folder as the files to be moved and that is the folder I am executing from. It does not seem to be a permissions issue as I tried it with superuser privledges as well.
I tried specifying the path to the file in files.txt as well but with the same result.
I have tried a number of xarg commands as well with no success.
Anyone have any ideas?
Thanks.
At my age I still learn something new every day, but I forget two others.