* Re: Piping output of sox to a file produces empty text
2020-07-27 19:02 ` Jeff Learman
@ 2020-07-27 19:04 ` Jeff Learman
2020-07-27 19:42 ` Måns Rullgård
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Learman @ 2020-07-27 19:04 UTC (permalink / raw)
To: sox-users
[-- Attachment #1.1: Type: text/plain, Size: 1069 bytes --]
Should have added:
If it's working correctly, you won't see the output.
What that stuff on the end means is, send stdout to file.txt, and make fd 2
(which is stderr) a copy of fd 1 (which is stdout).
On Mon, 27 Jul 2020 at 15:02, Jeff Learman <jjlearman@gmail.com> wrote:
> I didn't check, but perhaps sox text output is going to stderr. For
> Linux/UNIX, using many shells (sh, ksh, tsh, zsh, bash, but not csh),
> redirect stderr this way:
>
> sox file.mp3 -n stat > file.txt 2>&1
>
> Jeff
>
> On Mon, 27 Jul 2020 at 14:49, Ariel Elkin <ariel@arivibes.com> wrote:
>
>> Hello,
>>
>> I’d like to save the output of the stat command to a file.
>>
>> When I call
>> sox file.mp3 -n stat
>>
>> The output is correctly displayed. But If I then do
>> sox file.mp3 -n stat > file.txt
>>
>> file.txt is empty.
>>
>> Why?
>>
>> Thanks
>>
>> Ariel
>>
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>
[-- Attachment #1.2: Type: text/html, Size: 1967 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
[-- Attachment #3: Type: text/plain, Size: 158 bytes --]
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Piping output of sox to a file produces empty text
2020-07-27 19:02 ` Jeff Learman
2020-07-27 19:04 ` Jeff Learman
@ 2020-07-27 19:42 ` Måns Rullgård
1 sibling, 0 replies; 4+ messages in thread
From: Måns Rullgård @ 2020-07-27 19:42 UTC (permalink / raw)
To: Jeff Learman; +Cc: sox-users
Jeff Learman <jjlearman@gmail.com> writes:
>> On Mon, 27 Jul 2020 at 14:49, Ariel Elkin <ariel@arivibes.com> wrote:
>>
>>> Hello,
>>>
>>> I’d like to save the output of the stat command to a file.
>>>
>>> When I call
>>> sox file.mp3 -n stat
>>>
>>> The output is correctly displayed. But If I then do
>>> sox file.mp3 -n stat > file.txt
>>>
>>> file.txt is empty.
>>>
>>> Why?
>
> I didn't check, but perhaps sox text output is going to stderr. For
> Linux/UNIX, using many shells (sh, ksh, tsh, zsh, bash, but not csh),
> redirect stderr this way:
>
> sox file.mp3 -n stat > file.txt 2>&1
Per the man page, "The information is output to the `standard error'
(stderr) stream."
--
Måns Rullgård
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
^ permalink raw reply [flat|nested] 4+ messages in thread