On Thu, Apr 7, 2016 at 8:12 AM, Alex Dowling <[email protected]> wrote:
> Hello,
>
> I have a Julia script that does some analysis and includes println()
> statements. When I use julia my_code.jl > output.txt 2>&1 from a Linux
> command line, output from optimization solvers (IPOPT, Gurobi) are
> redirected to output.txt but output from println() just vanishes. They
> aren't in output.txt or printed to the console.

Are they vanished or delayed? The output is buffered.

>
> One option I found (haven't tested) is using redirect_stout() and
> redirect_sterr(): https://github.com/JuliaLang/julia/issues/12050. Ideally
> I'd like to redirect println output without modifying the script.

http://man7.org/linux/man-pages/man1/script.1.html

>
> Thanks,
> Alex

Reply via email to