.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
标签:.sh shel mod 双引号 div script roo body gpo
.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
标签:.sh shel mod 双引号 div script roo body gpo
原文地址:https://www.cnblogs.com/Lorentz-Z/p/8641367.html