Ruby get return from system command (sox) -


i trying assign stats sox command ruby variable. when using system 'true/false' depending on success of command. i've tried:

%x{ sox file -n stats } 

this shows stats in console, returns empty string, so:

stat: 123 stat: 234 "" 

i want obtain string contains stats. possible?

use ticks:

result = `sox file -n stats` 

make sure sox doesn't output stderr. in such case redirect.

result = `sox file -n stats 2>&1` 

edit ticks , %x{} same. sorry. mixed system. redirect need.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -