0
我的腳本中有以下代碼。還有50個像這樣的命令:處理shell腳本中的常量和變量
"SELECT date, count(*) FROM ttc_table....date_sub(current_date, **30**)" > **/path/location/file1.txt**
"SELECT date, count(*) FROM ascc_table....date_sub(current_date, **30**)" > **/path/location/file2.txt**
"SELECT date, count(*) FROM bmtc_table....date_sub(current_date, **30**)" > **/path/location/file3.txt**
我想爲值30創建常量併爲filepath指定一個變量。
什麼是最好的方法?
看看這個:http://www.compciv.org/topics/bash/variables-and-substitution/或者在SO上搜索「* bash變量替換*」。 – Arminius