Re: [Bashburn-info] cdrecord OPTIONS dump
Brought to you by:
bashburn
From: Steven W. O. <st...@sy...> - 2008-10-08 02:48:38
|
On Tuesday, Oct 7th 2008 at 12:50 -0000, quoth Nick Warne: =>On Mon, 06 Oct 2008 22:52:23 +0200 =>Markus Kollmar <mar...@on...> wrote: => =>> Yes you are right, I think also it is much work to grep the output of =>> the burner-option (since it seems not strongly formated and some part =>> of output goes not to stdout I think.) => =>As an aside on this, I too like Markus couldn't work out why some of =>the dump goes to STDOUT and some doesn't seem to go anywhere yet still =>gets printed to terminal. => =>i.e. compare: => =>cdrecord dev=/dev/<your_drive> driveropts=help -checkdrive => =>with: => =>cdrecord dev=/dev/<your_drive> driveropts=help -checkdrive > /dev/null => =>with: => =>cdrecord dev=/dev/<your_drive> driveropts=help -checkdrive | grep -i =>Driver => =>I dunno how J?rg Schilling has done this. In the man page quote: => =>"driveropts=option list => Set driver specific options. The options are specified a =>comma separated list. To get a list of valid options use =>driveropts=help together with the -checkdrive option. If you like to =>set driver options without running a typical cdrecord task, you need to =>use the -setdropts option in addition, otherwise the command line =>parser in cdrecord will complain." => => =>Command line parser? So he somehow does some magic? => =>I have never seen this behaviour in any application ever before. => =>Nick 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? -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net |