LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225

Quote:
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.

Quote:
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:

Code:
# 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
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Quote:
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.
 
  


Reply

Tags
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


All times are GMT -5. The time now is 10:30 PM.

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