diff --git a/tools/sof-kernel-log-check.sh b/tools/sof-kernel-log-check.sh index d675d600..a7be83d5 100755 --- a/tools/sof-kernel-log-check.sh +++ b/tools/sof-kernel-log-check.sh @@ -115,18 +115,19 @@ esac # kernel file log buffer size #kernel_buffer_size=$(du -k /var/log/kern.log |awk '{print $1;}') # now decide using which to catch the kernel log -#[[ $kernel_buffer_size -lt $dmesg ]] && cmd="dmesg" || cmd="sed -n '$begin_line,\$p' /var/log/kern.log" +#[[ $kernel_buffer_size -lt $dmesg ]] && cmd="dmesg" || cmd="tail -n +${begin_line} /var/log/kern.log" # confirm begin_line is number, if it is not the number, direct using dmesg [[ "${begin_line//[0-9]/}" ]] && begin_line=0 -[[ "$begin_line" -eq 0 ]] && cmd="dmesg" || cmd="sed -n '$begin_line,\$p' /var/log/kern.log" +[[ "$begin_line" -eq 0 ]] && cmd="dmesg" || cmd="tail -n +${begin_line} /var/log/kern.log" #echo "run $0 with parameter '$*' for check kernel message error" +# declare -p cmd if [ "$ignore_str" ]; then - err=$(eval $cmd|grep 'Call Trace' -A5 -B3)$(eval $cmd | grep -E "$err_str"|grep -vE "$ignore_str") + err=$( $cmd | grep 'Call Trace' -A5 -B3)$( $cmd | grep -E "$err_str"|grep -vE "$ignore_str") else - err=$(eval $cmd|grep 'Call Trace' -A5 -B3)$(eval $cmd | grep -E "$err_str") + err=$( $cmd | grep 'Call Trace' -A5 -B3)$( $cmd | grep -E "$err_str") fi if [ "$err" ]; then