cdrecord scripting question.

Harry Putnam reader at newsguy.com
Fri Sep 3 16:32:05 UTC 2004


Wayne Pinette <Wpinette at cariboo.bc.ca> writes:

> I try to log everything I do and then print off the log.  Unfortunately
> the output I get from
> cdrecord is not actually going to the log file so there is no
> information as whether the backup was
> successful or not, which makes the printout pretty much useless.

I didn't study your script but I suspect that some of what you want to
capture is coming out on STDERR.  If so it would print to tty but
would not be caught with > or >>.

Here is one suggestion that might help:

  To determine if this is a problem.
Run suspect commands like: `cmd 2> er'
Sending STDER to filename `er' (check er for output)

You might want to use an old trick I often use.  Use tee instead of > or >>.

the equivalent of `cmd >> filename' would be `tee -a filename'

What it does is print stuff to screen and to file.  You can see what
is happening better.

To capture STDERR into `tee' use this syntax.  STDERR will endup printed
to screen and to `file'.

cmd 2>&1|tee file 
  or
cmd 2>&1|tee -a file (to append)





More information about the redhat-list mailing list