Hi,
I am trying to clean files from various directories and copy them under "cleaned" directory, but I want to create the directory structure of the cleaned file under the cleaned directory at runtime.
F.eg: I cleaned a file using SED command as below..
sed 's/\/users\/ciimdrp/g' $fname > /users/ciimdrp/cleaned/$fname.
The value of $fname here is ./aop/sqr/test.txt
After cleaning the file, if the ./aop/sqr does not exists under the /users/ciimdrp/cleaned directory then the program must create that directory under the cleaned dir path and copy the file there else just copy the file or overwrite the existing file.
I hope I have conveyed properly what I am looking for !.
Thank you in advance.
I am trying to clean files from various directories and copy them under "cleaned" directory, but I want to create the directory structure of the cleaned file under the cleaned directory at runtime.
F.eg: I cleaned a file using SED command as below..
sed 's/\/users\/ciimdrp/g' $fname > /users/ciimdrp/cleaned/$fname.
The value of $fname here is ./aop/sqr/test.txt
After cleaning the file, if the ./aop/sqr does not exists under the /users/ciimdrp/cleaned directory then the program must create that directory under the cleaned dir path and copy the file there else just copy the file or overwrite the existing file.
I hope I have conveyed properly what I am looking for !.
Thank you in advance.