在Bash中使用{}和变量

时间:2015-12-29 18:53:06

标签: bash

在bash中使用和不使用{}$variable之间有什么区别?

在下面的两个陈述中,哪一个是现代的和推荐的方式写bash脚本(bash版本3.2+以上)

[~]$ variable=hello
[~]$ echo "$variable world"
hello world
[~]$ echo "${variable} world"
hello world

0 个答案:

没有答案