【发布时间】:2012-02-03 22:00:40
【问题描述】:
我正在尝试将一些文本组合到一个变量中并输出组合变量的值。例如:
testFILE=/tmp/some_file.log
function test_param {
echo $1
echo test$1
echo $(test$1) #this is where I want to output the value of the combined variable
}
test_param FILE
输出将是:
FILE
testFILE
/tmp/some_file.log <-- this is what I can't figure out.
有什么想法吗?
如果我没有使用正确的术语,请纠正我。
谢谢, 贾里德
【问题讨论】:
-
@bitbucket 它输出到哪里?或者我得到的输出是什么?
-
要获得正确答案,您需要提供错误答案作为线索。你有输出吗?
-
请看BashFAQ/006。
标签: linux bash variables substitution