.sh 文件执行权限赋予 chmod ( -u root )-x script.sh
单引号 无视变量 双引号 执行变量
例:
a1=‘phone‘
a2=‘this is a ${a1}‘
echo ${a2}
结果: this is a ${a1}
a1=‘phone‘
a2="this is a ${a1}"
echo ${a2}
结果: this is a phone
原文地址:https://www.cnblogs.com/Lorentz-Z/p/8641367.html
时间: 2024-10-25 08:11:14