Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash Julia从命名管道到提交日志的输出_Bash_Redirect_Julia_Named Pipes - Fatal编程技术网

Bash Julia从命名管道到提交日志的输出

Bash Julia从命名管道到提交日志的输出,bash,redirect,julia,named-pipes,Bash,Redirect,Julia,Named Pipes,我正在尝试以下操作,以在bash脚本中创建Julia实例,运行Julia脚本,然后将所有输出重定向到submission.log: mkfifo pipe sleep 1000000 > pipe & julia < pipe & { echo "include(\"test.jl\")" > pipe wait } &> submission.log mkfifo管道 睡眠1000000>管道& 茱莉亚:烟斗& { echo“

我正在尝试以下操作,以在bash脚本中创建Julia实例,运行Julia脚本,然后将所有输出重定向到submission.log:

mkfifo pipe
sleep 1000000 > pipe &
julia < pipe &

{
    echo "include(\"test.jl\")" > pipe
    wait
} &> submission.log
mkfifo管道
睡眠1000000>管道&
茱莉亚:烟斗&
{
echo“include(\“test.jl\”)管道
等待
}&>submission.log

但是,输出将转到控制台,submission.log为空。什么是好的解决方案?

您必须重定向Julia进程的stdout和stderr:

julia <pipe >stdout.txt 2>stderr.txt &
julia stdout.txt 2>stderr.txt&

谢谢Bogumit。将为后续问题启动另一个线程