[英]Run terminal from script and substitute command with a variable
Can anyone tell me how can this be accomplished ? 谁能告诉我如何做到这一点?
COMMAND=TEST
xterm -hold -e 'echo $COMMAND'
Using this example, I expect "TEST", but I get nothing. 使用此示例,我期望“ TEST”,但我什么也没得到。
Is this what you want to achieve? 这是您要达到的目标吗?
It pops the xterm window with the output of TEST
它用TEST
的输出弹出xterm窗口
variable="TEST"
COMMAND="echo $variable"
xterm -hold -e $COMMAND
In your code variable is not expanded due to single quotes: 在您的代码变量中,由于单引号未展开:
'echo $COMMAND'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.