LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   need to copy all " *.SEED " files and paste them inside a new folder each time (https://www.linuxquestions.org/questions/programming-9/need-to-copy-all-%2A-seed-files-and-paste-them-inside-a-new-folder-each-time-842178/)

rastin_nz 11-03-2010 03:38 PM

need to copy all " *.SEED " files and paste them inside a new folder each time
 
Hi there,
I have a "while" loop ;
1. I need to create a folder at each run ( folder with different names)
Code:

mkdir $i // i can be a counter to have different name each time ?!!! not sure
2.I should then move all the files of type ".SEED" to the created folder. (copy > paste & delete from the current directory)
Code:

rm *.SEED  //need help I do not know how to transfer the files
your help is appreciate

serafean 11-03-2010 05:02 PM

hi, to create a directory with a unique name at each run, "mkdir $i.$$" will append the PID to $i, and if $i is a counter, you'll get 1.PID, 2.PID ...
As for copy-> paste -> delete from source, you've just described the mv command.

Not sure I understood completely what you wanted though...

Serafean


All times are GMT -5. The time now is 09:30 PM.