shell将脚本输出结果记录到日志文件

使用tee命令:

sh portal/main.sh |tee log.txt

 

获取脚本父类路径
cmddir="`dirname $0`"

你可能感兴趣的:(shell将脚本输出结果记录到日志文件)