任何人都可以向我解释为什么一些 Linux 专家建议我们在 Bash 脚本中使用 ${VARIABLE} 吗?似乎没有任何区别。
最佳答案
假设您要打印 $VARIABLE
紧跟 "string"
echo "$VARIABLEstring" # tries to print the variable called VARIABLEstring
echo "${VARIABLE}string" # prints $VARIABLE and then "string"
Bash 还支持 string manipulation使用此语法。
关于linux - $VARIABLE 和 ${VARIABLE} 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8254864/