chuck icon indicating copy to clipboard operation
chuck copied to clipboard

chuck --probe output is not greppable

Open timurb opened this issue 5 years ago • 2 comments

When doing automation setups with ChucK you may need to grep its output of --probe command, or parse that in some other way.

Currently I don't see an easy way to do that — apparently all the output is sent to STDERR as a single line while all newline symbols are sent to STDOUT.

timurb avatar May 16 '19 06:05 timurb

If you are using the BASH shell you can try sending STDERR to an anonymous pipe. Below is an example on MacOS:

$ chuck --probe 2> >(grep -B1 Microphone)
[chuck]: ------( audio device: 2 )---------------
[chuck]: device name = "Apple Inc.: Built-in Microphone"
osx_version = 4245

juniorctl avatar Jun 05 '19 04:06 juniorctl

Right, probably some part of initial defect was fixed in a recent version -- in ChucK version which I checked all the output went to STDERR as a single string (with no linebreaks). Thus you can't grep.

I checked on MacOS and I confirm that you can grep STDERR now. Still putting all the output to STDERR doesn't look right to me.

timurb avatar Jun 05 '19 09:06 timurb