Re: [Bashburn-info] cdrecord OPTIONS dump
Brought to you by:
bashburn
From: Nick W. <ni...@uk...> - 2008-10-08 12:36:39
|
On Wed, 8 Oct 2008 12:25:36 +0100 Nick Warne <ni...@uk...> wrote: > 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. Now we need a way to report that the drive /dev/ entered is invalid if no option is produced. i.e. change to /dev/cdrom999 and then look at drive options... Perhaps this could be done in Option 0) setting CD writer menu - get cdrecord to -checkdrive and if no output or error etc. tell the user. EXAMPLE: #: cdrecord dev=/dev/cdrom99 driveropts=help -checkdrive Cdrecord-ProDVD-ProBD-Clone 2.01.01a38 (i686-pc-linux-gnu) Copyright (C) 1995-2008 Jörg Schilling scsidev: '/dev/cdrom99' devname: '/dev/cdrom99' scsibus: -2 target: -2 lun: -2 Warning: Open by 'devname' is unintentional and not supported. cdrecord: No such file or directory. Cannot open '/dev/cdrom99'. Cannot open or use SCSI driver. cdrecord: For possible targets try 'cdrecord -scanbus'. cdrecord: For possible transport specifiers try 'cdrecord dev=help'. Nick -- Free Software Foundation Associate Member 5508 |