Curious behavior: tail, grep, cut --- Bug?
From: M_F_H (no_one_at_example.com)
Date: 06/28/05
- Next message: Borek: "Re: Lynx Browser, fun stuff"
- Previous message: Kim André Akerĝ: "Re: Lynx Browser, fun stuff"
- Next in thread: Chris F.A. Johnson: "Re: Curious behavior: tail, grep, cut --- Bug?"
- Reply: Chris F.A. Johnson: "Re: Curious behavior: tail, grep, cut --- Bug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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...
- Next message: Borek: "Re: Lynx Browser, fun stuff"
- Previous message: Kim André Akerĝ: "Re: Lynx Browser, fun stuff"
- Next in thread: Chris F.A. Johnson: "Re: Curious behavior: tail, grep, cut --- Bug?"
- Reply: Chris F.A. Johnson: "Re: Curious behavior: tail, grep, cut --- Bug?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|