我看过几个帖子,比如 this one ,但没有人在我的特殊情况下帮助我。
scriptsPath="/var/db/gbi/scripts/"
echo "$scriptsPathawesome.csv";
我希望这会回显 /var/db/gbi/scripts/awesome.csv
相反,我得到 .csv
它似乎认为我正在尝试引用名为 $scriptsPathawesome
的变量。如何将 $scriptsPath
变量连接到 "awesome.csv"
字符串文字?
最佳答案
您需要像这样用大括号将您的变量括起来:
scriptsPath="/var/db/gbi/scripts/"
echo "${scriptsPath}awesome.csv";
关于linux - 连接字符串文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17729235/