Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-16-2012, 08:41 AM   #16
Senior Member
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,240

Rep: Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406

Originally Posted by oneindelijk
And if you use tail -f file | sed -u 's/ /Xx/g' ?
Yeah, it gets stuck, that's what I meant by reproduce the problem.

Originally Posted by Snark1994
I assume this is because 'tail' is waiting for a newline before passing anything through the pipe
I thought so too, but then I found that tail -f kermit.log | cat outputs everything. I think it's because sed operates on lines, so it has to wait for newline before it starts processing. Furthermore:

# this hangs (awk operates on lines by default):
tail -f kermit.log | gawk 1
# changing the record separator to multiple spaces does give output:
tail -f kermit.log | gawk -vRS=' +' 1
Old 10-16-2012, 08:57 AM   #17
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Originally Posted by ntubski View Post
I thought so too, but then I found that tail -f kermit.log | cat outputs everything.
Well, dang. So it does.


buffer accumulation, buffer flush, stdbuf, tail grep buffer

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash command history log - how to write it continuous? Skaperen Linux - Software 12 04-15-2011 03:56 PM
I never claimed to be that sharp... Python - log scanned barcode characters to file dogfuel Programming 7 10-09-2009 11:12 AM
Continuous ACPI errors in message log wufo Slackware 1 08-06-2009 01:15 AM
bash script to find out more than 1 continuous special characters in a file. kkpal Linux - Newbie 1 06-02-2008 05:56 AM
Regarding replacing characters in log file rajaniyer123 Linux - General 4 04-12-2008 11:32 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration