0

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).

Toto
  • 89,455
  • 62
  • 89
  • 125
Vvojtek
  • 43
  • 6
  • If you just want to check whether a file is growing, run `tail -f` and have it run a command as soon as there is any output. – tripleee Jul 15 '21 at 19:00
  • Yes, I want to compare it. For example: I will do "dmesg > $flog" every 10minutes, and when number lines in 'wc -l' is greater than previous, then I want to check $flog (dmlog) – Vvojtek Jul 15 '21 at 19:36
  • Compare the file by the number of lines of this file. – Vvojtek Jul 15 '21 at 19:52

0 Answers0