Shell中的变量使用小结
变量的定义,只能以字母和下划线开始,区分大小写,可以包含数字字母下划线.详见官方手册
[root@svnshell_example]#yourname='Linux' [root@svnshell_example]#echo$yourname Linux [root@svnshell_example]#YourName="linux" [root@svnshell_example]#echo"Thevariableis$YourName" Thevariableislinux
获取当前日期的脚本,常用在日志切割中,为了区分每天的日志文件
如下 生成2015年4月27日
[root@svnshell_example]#echo`date+%Y%m%d` 20150427 [root@svnshell_example]#cattoday.sh #!/bin/bash
TODAY=`date+%A` YEAR=`date+%Y年%m月%d日` echo"今天是$YEAR,$TODAY"
[root@svnshell_example]#shtoday.sh 今天是2015年04月27日,星期一
热门推荐
10 海南考试祝福语结婚简短
11 三八祝福语简短文案
12 送女孩的简短祝福语
13 鼠年元旦生日祝福语简短
14 红包祝福语简短10字
15 圣诞祝福语简短贺卡英文
16 送行长的祝福语简短
17 66红包祝福语简短的
18 开工红包祝福语毕业简短