dmesg log to file, and check number of lines

35 Views Asked by At

i trying to drop last new lines(if exists) of dmesg to a file. I want to echo it if there is new lines that file. There isn't much of it, but i have something like this:

flog=$DIR/dmlog
dm=$(dmesg > $flog)
lines=$(wc -l $flog) <--- for example there is 60 lines

I need to check if number of lines is greater than previouse one (60).

0

There are 0 best solutions below