Loading [Contrib]/a11y/accessibility-menu.js
Previous: open Next: success

TECHIO> redirect-streams


TECHIO> redirect-streams [OPTIONS] <OUT_CHANNEL>


Redirects the standard streams (standard output stream and standard error stream) to a OUT_CHANNEL.

If the OUT_CHANNEL is not specified, the default value is out.

The special null channel is used to redirect the stream to a void channel. Thus, the printed content will not be displayed.


-i, --input <CHANNEL>[,CHANNEL,…] List of input CHANNELS to redirect to the OUT_CHANNEL. It can be 'out' for the standard output stream, 'err' for the standard error stream or any other channel you define. The default value is out,err.

-p, --pattern <PATTERN> Redirects only the strings matching the given regular expression PATTERN.

-r, --reset Cancel all the redirections and restore the default behaviour. This option should be used online (exclusion of other)


Redirect both standard output and standard error stream to the out channel:

TECHIO> redirect-streams out

Redirect the standard error stream err to the compilation error channel:

TECHIO> redirect-streams --input "err" "compilation error"

Redirect the strings written on the standard error stream and starting with the value [DEBUG]: to the debug channel:

TECHIO> redirect-streams --input "err" --pattern "^\[DEBUG\]:" debug

Reset all redirections:

TECHIO> redirect-streams --reset

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
Online Participants