Friday, December 5, 2014

Unix/Shell Script: Send a file to multiple subdirectories

Hey!

This was a fantastic piece of code, get a look.
It's the real deal if you want to send one file to multiple sequential subdirectories:


        printf "bomba_000%02i " $(seq 1 10) | xargs -n 1 cp puzzle.xml


Got this amazing solution from here: http://unix.stackexchange.com/questions/49011/copying-a-single-file-to-multiple-directories-using-cp

I'll probably update this to be a little bit more specific on generic names, but for now it's awesome.
Cheers.

No comments:

Post a Comment

Tweet