ZKX's LAB

shell脚本循环读取更新了的文件并处理 shell循环跑文件数据

2021-04-09知识0

linux shell两个文件数值相加 #。bin/bashn=1for i in `2113cat 1.txt`;do#循环1.txt5261num=`sed-n\"${n}p\"2.txt`#获取2.txt对行的数4102字sum=$(($num+$i))#两数相加echo$sum#打印结果1653n=$(($n+1))done

linux shell 循环执行 备份文件 for db in(shop shop_dev caiwu21 zkqe bugfree zentao);doDB=$dbusr/local/mysql/bin/mysqldump-u$USER-p$PW-lock-all-tables$DB>;/bak/$DB1$DATE.sqldone

shell脚本循环读取更新了的文件并处理 假设在当前文件夹下有多个.txt文件,现要求用for循环读取更新了的文件for ofile in '.'do#处理程序donedata>;timesdump;。

#shell编程循环#shell脚本循环读取文件#shellfor循环语法#shell循环跑文件数据

随机阅读

qrcode
访问手机版