sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Piping output of sox to a file produces empty text
@ 2020-07-27 16:17 Ariel Elkin
  2020-07-27 19:02 ` Jeff Learman
  0 siblings, 1 reply; 4+ messages in thread
From: Ariel Elkin @ 2020-07-27 16:17 UTC (permalink / raw)
  To: sox-users

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Piping output of sox to a file produces empty text
  2020-07-27 16:17 Piping output of sox to a file produces empty text Ariel Elkin
@ 2020-07-27 19:02 ` Jeff Learman
  2020-07-27 19:04   ` Jeff Learman
  2020-07-27 19:42   ` Måns Rullgård
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Learman @ 2020-07-27 19:02 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 740 bytes --]

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: 1314 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: 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

end of thread, other threads:[~2020-07-27 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 16:17 Piping output of sox to a file produces empty text Ariel Elkin
2020-07-27 19:02 ` Jeff Learman
2020-07-27 19:04   ` Jeff Learman
2020-07-27 19:42   ` Måns Rullgård

sox-users@lists.sourceforge.net unofficial mirror

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/sox-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 sox-users sox-users/ https://public-inbox.org/sox-users \
		sox-users@lists.sourceforge.net
	public-inbox-index sox-users

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/sox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git