共计 468 个字符,预计需要花费 2 分钟才能阅读完成。
#!/bin/bash
projeck_dir_name=/data/service
projeck_pwd_name=$(ls ${projeck_dir_name})
log_error_tail(){select color in ${projeck_pwd_name}
do
tail -200f ${projeck_dir_name}/${color}/*/*/log_error.log
done
}
log_info_tail(){select color in ${projeck_pwd_name}
do
tail -200f ${projeck_dir_name}/${color}/*/*/log_info.log
done
}
echo " 请输入需要查看的日志 1 为查看 info 2 为查看 error"
select var in " 查看 info" " 查看 error"
do
if [$var = " 查看 info"]; then
log_info_tail
elif [$var = " 查看 error"]; then
log_error_tail
else
echo " 请输入正确的参数 "
break
fi
done
正文完