在shell脚本中,我们{}何时在扩展变量时使用?
{}
例如,我见过以下内容:
var=10 # Declare variable echo "${var}" # One use of the variable echo "$var" # Another use of the variable
是否存在显着差异,还是只是风格?一个比另一个更受欢迎吗?
syntax bash shell curly-braces
bash ×1
curly-braces ×1
shell ×1
syntax ×1