Inconsistent behavior #37
Replies: 3 comments 1 reply
-
By default only stdout output is captured into variable, and stderr is logged into your logger. You can redirect stderr to stdout if you want to capture it into variable: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion. I changed the command to this:
Since ffmpeg always log to stderr, and I redirected stderr to result.txt, I can get the log in the text file and the
Here I redirect stderr to stdout, which should make the variable |
Beta Was this translation helpful? Give feedback.
-
Try |
Beta Was this translation helpful? Give feedback.
-
I'm using version 1.2.2 and I have the following program.
When I run it, I can get the expected result like:
When I change the command
ls -la
to more complex one (which probably takes several seconds to complete), I get empty output.Output is:
But can I find the produced output file of the ffmpeg command, which indicates the command did run. If I enabled the logger like this:
I can get the ffmpeg output in the console:
But note the
""
at the end of the output, I still can't get the output in the variableoutput
and it still contains an empty string.Why for simple command, the output is captured in a variable. But for complex command, it doesn't do this. Is this inconsistence a bug? How can I store the command output in a variable when the command is kinda complex? Thank.
Beta Was this translation helpful? Give feedback.
All reactions