案例: -d
如果目录不存在则创建
[ -d /etc ] && mkdir /opt/`hostname`_`date +%F` && tar zcvf /opt/`hostname`_`date +%F`/etc.tar.gz /etc
#!/bin/bash
[ -f /server/scripts/day02/env.sh ] && . /server/scripts/day02/env.sh
echo $num1+$num2=$[$num1+$num2]
案例: -d
如果目录不存在则创建
[ -d /etc ] && mkdir /opt/`hostname`_`date +%F` && tar zcvf /opt/`hostname`_`date +%F`/etc.tar.gz /etc
#!/bin/bash
[ -f /server/scripts/day02/env.sh ] && . /server/scripts/day02/env.sh
echo $num1+$num2=$[$num1+$num2]