标签:使用 注意 The python txt 标准输出 exit exec sage
#!/bin/sh if [ $# -ne 1 ] then echo "Usage:sh $0 YYYYMMDD " exit 1 fi V_DT=$1 exec 1>>`basename $0`.log date_current=`date +%Y%m%d` echo "传入时间为: ${V_DT}" echo "系统时间为: ${date_current}" exit 0
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Usage:sh $0 YYYYMMDD "
exit 1
fi
V_DT=$1
date_current=`date +%Y%m%d`
echo "传入时间为: ${V_DT}" >> $(basename $0).log
echo "系统时间为: ${date_current}" >> $(basename $0).log
echo "tee commant test" 2>&1|tee -a $(basename $0).log --日志和屏幕都存在
exit 0
[python@master test]$ sh test.sh 20181010 [python@master test]$ sh test2.sh 20181010 tee commant test [python@master test]$ more test2.sh.log 传入时间为: 20181010 系统时间为: 20181029 tee commant test
标签:使用 注意 The python txt 标准输出 exit exec sage
原文地址:https://www.cnblogs.com/hello-wei/p/9872342.html