Re: [Bashburn-info] cdrecord OPTIONS dump
Brought to you by:
bashburn
From: Markus K. <mar...@on...> - 2008-10-08 09:37:21
|
Nick Warne wrote: > On Tue, 7 Oct 2008 22:48:22 -0400 (EDT) > "Steven W. Orr" <st...@sy...> wrote: > > >> The reason is that that command writes to stderr and not to stdout. >> So, if you want your command to pipe its stderr to grep you have to >> say this: >> >> cdrecord dev=/dev/<your_drive> driveropts=help -checkdrive 2>&1 | \ >> grep -i Driver >> >> which sez in English: "run the command and dup(2) stderr onto stdout >> and close stderr. Then take the combined stderr and stdout that is >> now on stdout and pipe it to grep." >> >> Make sense? >> > > Yes, I think we all know about that... but it wasn't something I > thought about. > > Anyway, it still is peculair. The line below NOW only prints out Driver > Options (I guess 20 lines will be enough) but still have to dump > to /dev/null. > > cdrecord dev=/dev/<you_drive> driveropts=help -checkdrive 2>&1 > >> /dev/null | grep -A 20 "Driver options" >> > > Please test this line - if it works for all of us, I guess it could be > used to only print out drivers options. > > Nick > Nick, yes this works for me. Note, for those who first maybe wondered also about the "missing" redirection char: Some mail programms format the ">" before "/dev/null" to a graphical vertical line (they interpret it as reply-statements). Looking the message in source form shows that Nick formated it correct. :-) Markus |