贴一段shell代码
好久没用shell了,呵呵
#!/usr/bin/env bash COUNTER=1 while [ $COUNTER -lt 1000 ]; do echo The counter is $COUNTER cat<<EOF >>tmp.sql INSERT INTO "wcdata" VALUES(‘`(printf "%03d" $COUNTER)`‘,‘0.00‘,‘0.00‘,‘0.00183‘,‘85.47943‘,‘4773267.7216‘,‘-10669.18‘); EOF echo The counter is $COUNTER cat<<EOF >>tmp.sql INSERT INTO "wcxx" VALUES(‘`(printf "%03d" $COUNTER)`‘,‘同步输出‘,‘模拟小电压,0.5V‘,‘模拟小电压,0.5V‘,‘‘,‘2015-01-23-19-52-36‘); EOF let COUNTER=COUNTER+1 done
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。