简单东西, 记录一下:
#!/bin/bash if [ $# -ne 1 ]; # 参数个数判断 then echo "error,usage: $0 20171025" exit 1; fi t1=$(date -d $1 +%s) # 时间戳 echo $t1执行:
xxxxxx ./a.sh error,usage: ./a.sh 20171025 xxxxxx ./a.sh 20171025 1508860800以后写shell script,不要总是这这那那的, 丑! 原文链接:https://www.f2er.com/bash/389953.html