大家好
我將我的 code 簡化後如下:
A_var=/home/fileA.txt
B_var=/home/fileB.txt
for nn in A B
do
head $"${nn}_var"
done
希望能有
head /home/fileA.txt
head /home/fileB.txt
的效果
但我試了各種加上括號或引號的組合都沒有辦法,所以上來問問看,謝謝大家!
--
我將我的 code 簡化後如下:
A_var=/home/fileA.txt
B_var=/home/fileB.txt
for nn in A B
do
head $"${nn}_var"
done
希望能有
head /home/fileA.txt
head /home/fileB.txt
的效果
但我試了各種加上括號或引號的組合都沒有辦法,所以上來問問看,謝謝大家!
--
All Comments