例子1:
[root@localhost opt]# cat a.sh #!/bin/bash source /opt/b.txt aa=${!1} echo $aa [root@localhost opt]# cat b.txt abc=1 [root@localhost opt]# sh a.sh abc 1
例子2:
[root@localhost opt]# cat a.sh #!/bin/bash a=1 b=a echo ${b} echo ${!b} eval echo \$$b [root@localhost opt]# sh a.sh a 1 1
获取前一天时间
date -d -1day +%Y%m%d