Subject: Re: bug#25475: tail -f behaviour

From: f0rhum <[email-masked]>
Date: Thu, 19 Jan 2017 00:44:29 +0100

tail -fn20 -s30 file
...
2017-01-18 22:55:00  10  0V18  +1C 0A00 500mA 11V70  20% 2A30 11861
Date            Heure   Mes. Vpan. Tmp.  Ich.  Conso   Vbat.   SoC  Sta 
Vin mV
2017-01-18 23:00:01  10  0V17  +1C 0A00 500mA 11V71  19% 2A30 11879
2017-01-18 23:05:00  10  0V17  +0C 0A00 480mA 11V71  20% 2A30 11868
2017-01-18 23:10:00  10  0V18  +0C 0A00 500mA 11V70  19% 2A30 11865
2017-01-18 23:15:00  10  0V16  +0C 0A00 510mA 11V69  19% 2A30 11832
  --> Vbat<11V70: Delestage automatique de 9h08mn
2017-01-18 23:20:21 Controleur inaccessible
2017-01-18 23:25:21 Controleur inaccessible
^C
tail -fn20 -s30 file
...
2017-01-18 22:55:00  10  0V18  +0C 0A00 500mA 11V70  20% 2A30 11861
Date            Heure   Mes. Vpan. Tmp.  Ich.  Conso   Vbat.   SoC  Sta 
Vin mV
2017-01-18 23:00:01  10  0V17  +1C 0A00 500mA 11V71  19% 2A30 11879
2017-01-18 23:05:00  10  0V17  +0C 0A00 480mA 11V71  20% 2A30 11868
2017-01-18 23:10:00  10  0V18  +0C 0A00 500mA 11V70  19% 2A30 11865
2017-01-18 23:15:00  10  0V16  +0C 0A00 510mA 11V69  19% 2A30 11832
  --> Vbat<11V70: Delestage automatique de 9h08mn
2017-01-18 23:20:21 Controleur inaccessible
...
2017-01-19 00:10:04 Controleur inaccessible

For the 2 above, I didn't delete any line above. Only the line 23:25:21
in the first was replaced by my script with
...
23:30:xx ....  <--- which in turn was updated by a new similar messages
until a different message happens (note here this is an additionnal line)
I didn't have the idea that "file grows" can have 2 meaning : grows in
bytes, or grows in line numbers. Whatever, a new line was added between
iterations (one deleted then immediately 2 added), and 3 bytes added (43
deleted (then sed -i '$ d' $LOGF;), then immediately 3 + 43 printed
immediately in a single write (help of printf "...\n%s Controleur
inaccessible\n" "`date "+%F %X"`" >>$LOGF )

I must also clarify something : this not an issue for me, I just wanted
to share what I discovered.
I just discovered -f was great live help while tracking bugs in my script.

Bye bye