1.命令替换
#!/bin/bash #命令输出负载给变量的两种方式#反引号字符(`)#$()格式 d1=`date` d2=$(date) echo "The date d1 and time are: $d1" echo "The date d2 and time are: $d2"
shell 构建脚本基础
原文:https://www.cnblogs.com/zy09/p/10595554.html