[英]Shell script to extract all zip files in a directory and its sub directory, and copy the extracted files into another folder with same hierarchy
[英]shell how to apply a function to all the files in the directory and copy in another folder the results?
zcat 7days/src_file1.gz | head | ./addsubnets.py rndc_subnets.cfg |
gzip -9c > 7days_subnet/src_file1.gz
我有这个外壳功能。 它将操作应用于7days
文件夹中的文件,并将其保存在7days_subnet
文件夹中。 如何在7days
对所有文件重复此操作?
for file in 7days/*; do
file=${file#7days/}
zcat 7days/"$file" | head | ./addsubnets.py rndc_subnets.cfg |
gzip -9c > 7days_subnet/"$file"
done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.