标签:
好久没用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
标签:
原文地址:http://www.cnblogs.com/pied/p/4245042.html