在Linux中,单引号(')用于定义字符串
例如:
variable='Hello, World!'
echo 'The value of the variable is: $variable'
输出结果将是:
The value of the variable is: $variable
如果你想在单引号内显示变量的值,你需要使用双引号("):
variable='Hello, World!'
echo "The value of the variable is: $variable"
输出结果将是:
The value of the variable is: Hello, World!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:linux单引号用于变量赋值吗