Discussion:
[mad-user] Madplay capture output to file - how to?
Gurpal S. Bhachu
2003-08-18 22:38:27 UTC
Permalink
Hi,

I wish to capture the output of madplay to an external file eg:

$ madplay abc.mp3 -o abc.wav > abc.txt

It seems that abc.txt contains nothing! Is there some weird non standard
out thing happening here?
Please could someone advise how to do this...

Many thanks,
Gurpal
Ian Scott
2003-08-19 02:25:11 UTC
Permalink
Post by Gurpal S. Bhachu
Hi,
$ madplay abc.mp3 -o abc.wav > abc.txt
It seems that abc.txt contains nothing! Is there some weird non standard
out thing happening here?
Please could someone advise how to do this...
madplay is outputting on stderr instead of stdout. You can redirect stderr
to stdout with the directive '2>&1', so:
$ madplay abc.mp3 -o abc.wav 2>&1 > abc.txt
will work.
Or you can direct stderr directly to abc.txt:
$ madplay abc.mp3 -o abc.wav 2>abc.txt

This is quite useful for other console programs that output on stderr.

Ian
Gurpal S. Bhachu
2003-08-20 23:04:03 UTC
Permalink
Thank you so much Ian, Rob L, Rob K - that's wat I was looking for "2>".
My unix skills a bit weak. Cheers..
-----Original Message-----
Sent: 19 August 2003 03:25
To: Gurpal S. Bhachu
Subject: Re: [mad-user] Madplay capture output to file - how to?
Post by Gurpal S. Bhachu
Hi,
$ madplay abc.mp3 -o abc.wav > abc.txt
It seems that abc.txt contains nothing! Is there some weird non
standard out thing happening here? Please could someone
advise how to
Post by Gurpal S. Bhachu
do this...
madplay is outputting on stderr instead of stdout. You can
redirect stderr to stdout with the directive '2>&1', so: $
madplay abc.mp3 -o abc.wav 2>&1 > abc.txt
will work.
$ madplay abc.mp3 -o abc.wav 2>abc.txt
This is quite useful for other console programs that output on stderr.
Ian
Loading...