I have a directory /originalthat contains hundreds of files. I have a script that will process files one at a time and delete the file so that it does not run again if the script is interrupted. So, I need a bunch of soft file links from /originalto /processing. Here is what I tried:
find / original -name "* .processme" -exec echo ln -s {} $ (basename {}) \;
and got something like:
ln -s /original/1.processme /original/1.processme
ln -s /original/2.processme /original/2.processme
ln -s /original/3.processme /original/3.processme
...
I wanted something like:
ln -s /original/1.processme 1.processme
ln -s /original/2.processme 2.processme
ln -s /original/3.processme 3.processme
...
It seems to $(basename)work before the conversion {}. Is there any way to fix this? If not, how else can I achieve my goal?
User1 source
share