1.命令替换
#!/bin/bash #命令输出负载给变量的两种方式
#反引号字符(`)
#$()格式
d1=`date` d2=$(date) echo "The date d1 and time are: $d1" echo "The date d2 and time are: $d2"
1.命令替换
#!/bin/bash #命令输出负载给变量的两种方式
#反引号字符(`)
#$()格式
d1=`date` d2=$(date) echo "The date d1 and time are: $d1" echo "The date d2 and time are: $d2"