Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-01-2010, 09:13 AM   #1
LQ Newbie
Registered: Jun 2010
Posts: 11

Rep: Reputation: 0
Weird thing in redirecting stdout and stderr

Hi... I'm trying to redirect the progress percentage of the mkisofs command to a zenity window... the thing is, mkisofs prints the xx% to the stderr... so what I'm trying to do is:

mkisofs options ../filename.iso . 2>&1 | grep done
and that "works"... I mean, it does print the correct lines on the terminal... however if a try to write to a file, or pipe it to another command, awk for example:

mkisofs options ../filename.iso . 2>&1 | grep done | awk '{print $1}'
it doesn't print anything...

mkisofs options ../filename.iso . 2>&1 | grep done > foo
this will make foo an empty file...

what am I doing wrong?
Old 07-01-2010, 10:18 AM   #2
LQ Newbie
Registered: Jun 2010
Posts: 11

Original Poster
Rep: Reputation: 0
it is working, but the numbers are printed almos all at once at the end of iso building.
Old 07-01-2010, 12:09 PM   #3
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Might be line buffering by grep. Try to use grep --line-buffered

I had a similar issue and matir suggested the above.


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
example for redirecting stderr,stdout in seperate files using two way pipes concept nagendrar Programming 0 07-06-2009 07:08 AM
redirecting BASH script stdout/stderr from the script itself Hewson Linux - General 4 04-18-2008 04:32 PM
Redirecting stdout, stderr to pty0? Rostfrei Linux - General 4 03-20-2007 04:15 AM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 03:36 AM
redirecting stdout and stderr to a file Avatar33 Programming 4 03-12-2005 08:55 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:27 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