Bash malfunction, or something else ??

David Curry dsccable at comcast.net
Mon Jan 24 05:06:49 UTC 2005


Richard Hubbell wrote:

>Since you don't really give the details I would bet
>that you're expecting cdrecord to print only on stdout but it
>probably prints to stderr as well.
>
>Capture stdout and stderr to a file and see if that is what you expect.
>
>cdrecord -scanbus 2>&1 myfile
>
>Richard
>
>On Sun, 23 Jan 2005 22:44:09 -0500, David Curry <dsccable at comcast.net> wrote:
>  
>
>>Reference materials on commands and features of BASH that I have
>>consulted include material stating that a line command in the form
>>
>>$ command [options] [directory (if different than the current directory)
>>] > [filename]
>>
>>will re-direct the output of the command from stdout to the named file.
>>
>>In evaluating the installation of FC2 on my PC (box?), I have noticed a
>>difference between outputs sent to stdout and outputs to > [filenames].
>>
>>Is this a bug?
>>
>>To illustrate, cdrecord -scanbus > scanbus.txt on my machine produces
>>the following text file.
>>
>>listing of scanbus.txt:
>>Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004
>>Jörg Schilling
>>Note: This version is an unofficial (modified) version with DVD support
>>
>>Note: and therefore may have bugs that are not present in the original.
>>Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
>>Note: The author of cdrecord should not be bothered with problems in this version.
>>Using libscg version 'schily-0.8'.
>>scsibus1:
>>        1,0,0   100) 'ATAPI   ' 'CD-R/RW 24X10   ' 'P.MJ' Removable CD-ROM
>>        1,1,0   101) 'LITEON  ' 'CD-ROM LTN301   ' 'MM07' Removable CD-ROM
>>        1,2,0   102) *
>>        1,3,0   103) *
>>        1,4,0   104) *
>>        1,5,0   105) *
>>        1,6,0   106) *
>>        1,7,0   107) *
>>
>>Output of cdrecord -scanbus directed to stdout reads
>>
>>Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
>>Note: This version is an unofficial (modified) version with DVD support
>>Note: and therefore may have bugs that are not present in the original.
>>Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
>>Note: The author of cdrecord should not be bothered with problems in this version.
>>scsidev: 'ATA'
>>devname: 'ATA'
>>scsibus:  -2 target:  -2 lus:  -2
>>Linux sg driver version: 3.5.27
>>Using libscg version 'schily-0.8'.
>>cdrecord:  Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.83-RH '@(#)scsi-linux-sg.c     1.83 04/05/20 Copyright 1997 J. Schilling').
>>scsibus1:
>>        1,0,0   100) 'ATAPI   ' 'CD-R/RW 24X10   ' 'P.MJ' Removable CD-ROM
>>cdrecord:  warning: controller returns wrong size for CD capabilities page.
>>        1,1,0   101) 'LITEON  ' 'CD-ROM LTN301   ' 'MM07' Removable CD-ROM
>>        1,2,0   102) *
>>        1,3,0   103) *
>>        1,4,0   104) *
>>        1,5,0   105) *
>>        1,6,0   106) *
>>        1,7,0   107) *
>>
>>There are six more lines of output sent to the display screen than are sent to a file via use of the > [filename] option in BASH.
>>
>>--
>>fedora-list mailing list
>>fedora-list at redhat.com
>>To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>>
>>    
>>
>
>  
>
Thanks, Richard.  As far as I knew all cdrecord -scanbus output was 
displaying on my monitor (stdout) and did not know that the first four 
lines omitted from the disk file I created were "errors" (scsidev: "ATA" 
-->  Linux sg driver version: 3.5.27).

Following Up on the suggestions of Jason Tibbits and Jim Cox, I repeated 
the exercise using &> instead of just > and the file produced included 
all of the missing lines.

Thanks again to all who responded.




More information about the fedora-list mailing list