Re: [Bashburn-info] cdrecord OPTIONS dump
Brought to you by:
bashburn
From: Nick W. <ni...@uk...> - 2008-10-08 11:25:50
|
On Wed, 08 Oct 2008 11:37:17 +0200 Markus Kollmar <mar...@on...> wrote: > 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. > > :-) > OK, I will commit this to TRUNK. Also I have appended an extra message to lang/German/Swedish/English/configure.lang to bb_conf_ch_dropts. This adds a 'Detecting CD Writer...' (using bb_text_7). The reason I done this is due to me having two drives. One dumps the options to the screen immediately, and the other takes about 3 seconds - so I end up looking at a blank screen wondering what is happening. This message now tells the user that the drive is being queried. Nick -- Free Software Foundation Associate Member 5508 |