linux shell 标准输出和错误输出定向问题
我想实现脚本的标准输出到一个文件run.log,错误输出到一个文件err.log,脚本如下:
. /etc/profile
. ~/.bash_profile
#打印hello world
echo "hello world"
#ls一个不存在的文件
ls abc.txt
正确写法错误输出(2)和重定向(>)不能有空格,标准输出(1)和重定向(>)不能有空格,如下:
nohup sh test.sh 2> err.log 1> run.log &
期间犯了错误
原创
2020-06-17 23:20:08 ·
460 阅读 ·
0 评论