Curious behavior: tail, grep, cut --- Bug?

From: M_F_H (no_one_at_example.com)
Date: 06/28/05


Date: Tue, 28 Jun 2005 15:23:31 -0400

Please explain this curiosity, seen on Fedora 4 and Knoppix 3.4:

1) tail -n200 /var/log/messages
produces the last 200 lines of the main log file,

2) tail -n200 -F /var/log/messages
produces the same as (1), but then prints any additional log entries that the
system produces,

3) tail -n200 /var/log/messages | grep "IN=ppp0"
finds the same lines as (1), but prints only the lines that contain the string
"IN=ppp0",

4) tail -n200 /var/log/messages | grep IN=ppp0" | cut -b1-100
prints the same results as (3), but only the first 100 bytes (i.e., characters)
of each line are printed,

5) tail -n200 -F /var/log/messages | grep "IN=ppp0" | cut -b1-100
is supposed to result in the same output as (4), and then print any additional
lines that the log file gets that passes the grep filter. However, on every
Linux machine I have tried, I typically get fewer lines than (4), truncated to
the first 100 bytes of each line. And the update feature appears not to work.
Same behavior whether one uses the -F or -f switch on tail.

(Sync has no affect on these results...)

Why is this happening? TIA...



Relevant Pages

  • Re: TextWidth() Alternative?
    ... length and TextWidthoverflows. ... Crazy. ... Out of curiosity, of what possible use is such information? ... I don't really see the problem, it's a log file that doesn't necessarily ...
    (microsoft.public.vb.general.discussion)
  • Re: How to debug fedora hanging after upgrading from rh9
    ... I just rebuilt it with ... fedora 4 ... There is nothing in the message log file. ... Are you running in runlevel 5 (with the X Window ...
    (Fedora)
  • Re: Turn off SELinux "avc: granted" logging
    ... We have started confining Userspace from these access checks, ... in your log file. ... We have worked hard to clean up all code shipped in Fedora to ... Clemson University Math Sciences ...
    (Fedora)
  • Re: Fedora core 6 and widescreen monitors?
    ... anyone have any idea how well fedora is at detecting non standard ... The important bit is that you can get X to tell you what modeline the ... EDID info claims you need in the log file, then you cut & paste the info ...
    (Fedora)
  • Re: Fedora core 6 and widescreen monitors?
    ... anyone have any idea how well fedora is at detecting non standard ... The important bit is that you can get X to tell you what modeline the ... EDID info claims you need in the log file, then you cut & paste the info ...
    (Fedora)