Can someone please show the simplest way to do this in a shell script.
I have the following list containing directory names:
head -3 list.txt
For each entry in the list.txt
cd into existing directory:
Take the prefix number and search in
find /usr/share/exploitdb/ -name 271.*
Copy the file to existing directory
cp /usr/share/exploitdb/platforms/windows/local/271.c .
Move back to parent directory:
What have i tried?
I found it simple enough to create the directories...
for fldr in $(cat list.txt); do mkdir -p $fldr; done
...but unsure of the best way to use cut and assign to variables etc. It would be great to learn experienced Linux users approach this.