Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的脚本中有变量,称为:
VAR=/opt/sbin/test
我想在行尾附加一个文本,例如“文本”,并带有一个空格,然后将该行运行为
/opt/sbin/test text
我认为您正在寻找的命令是:
VAR=/opt/sbin/test VAR="$VAR text" BLAH=$(${VAR})
以上将 $VAR 设置为 /opt/sbin/test 文本,然后 BLAH=$(${VAR}) 将执行它。