Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: qx and STDERR?

by Fletch (Bishop)
on Nov 25, 2019 at 19:32 UTC ( [id://11109196]=note: print w/replies, xml ) Need Help??


in reply to qx and STDERR?

If you've redirected things you should be getting the STDERR output as well.

$ perl -E '$foo = qx{zsh -c "print I GO TO OUT; print I GO TO ERR 1>&2 +" 2>&1}; say qq{foo: |$foo|}' foo: |I GO TO OUT I GO TO ERR |

My suspicion is that the output may be explicitly going to the tty instead of STDERR so redirection this way isn't going to affect it.

Update: Well nope, that's not it. Seems to capture things fine for me (OS X, perl 5.18.2, homebrew'd ffmpeg 4.2.1).

$ perl -E '$foo = qx{ffmpeg -f s16le -i /dev/null 2>&1}; say qq{foo: | +$foo|}' foo: |ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg develope +rs built with Apple LLVM version 10.0.0 (clang-1000.11.45.5) configuration: --prefix=/Users/fletch/lib/homebrew/Cellar/ffmpeg/4.2 +.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avr +esample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines +/jdk1.8.0_221.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMa +chines/jdk1.8.0_221.jdk/Contents/Home/include/darwin' --host-ldflags= + --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enabl +e-libbluray --enable-libmp3lame --enable-libopus --enable-librubberba +nd --enable-libsnappy --enable-libtesseract --enable-libtheora --enab +le-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --e +nable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig - +-enable-libfreetype --enable-frei0r --enable-libass --enable-libopenc +ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-li +brtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disa +ble-libjack --disable-indev=jack libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, s16le, from '/dev/null': Duration: N/A, bitrate: 705 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s At least one output file must be specified |

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11109196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-26 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found