https://gist.github.com/anonymous/678d384c050a0012559c
cmd="'select test_seq, year, month, day, hour, minute, name,\
hop_no, test1_hop, test1_RTT, test2_hop, test2_RTT, test3_hop, \
test3_RTT, usr_id from dmp.temp_table where label=$i'"
mysql -h localhost -u root -pf0409 -Bse $cmd > $file
为什么拆成这样不行 , echo $cmd 印出来的 mysql command 没问题 , 但是就是失败
必须改成下面写法才可以请问这是什么原因?
mysql -h localhost -u root -pf0409 -Bse "select test_seq, year, month, \
day, hour, minute, name, hop_no, \
test1_hop, test1_RTT, test2_hop, \
test2_RTT, test3_hop, test3_RTT, \
usr_id from test.temp_table where label=$i" > $file
谢谢