#!/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
最后修改:2021 年 10 月 28 日
如果觉得我的文章对你有用,请随意赞赏