programmer group

Linux script for defining variables

The existing two pieces of code are basically the same, but the variables are changed, and the others are unchanged, but the results are different during execution Code 1: vi back.sh #backup import file,such as /etc/rc.local /var/spool/cron/root IP=$(ifconfig eth1|sed -nr '2s#.*addr:(.*) B.*#\1#gp') Path=/backup if [ $(date +%w) -eq 0 ] then Time=$(date +%F-%w -d "-1 day") else Time=$(date +%F "-1 day") fi mkdir $Path/$IP...