Julia + named pipe crashing bash

@bkamins proposes in this post a way to use Julia over a named pipe.

Executing the code

mkfifo pipe
julia <pipe >log.txt 2>err.txt &
exec 3>pipe
echo "1+2" >&3
echo "X" >&3
echo "exit()" >&3 

cat log.txt
cat err.txt

in different environments:

  • Windows/Git Bash: echo “1+2” >&3 crashes
  • RedHat Linux/Konsole+bash: $ echo “1+2” >&3 crashes with Warning: Program ‘/bin/bash’ crashed.
  • RedHat Linux/Xterm+bash: working
$ echo "1+2" | julia
3

Normal piping always works. Bash experts?

FWIW, that code works just fine for me on Linux:

[pfitzseb@midgard bin]$ mkfifo pipe
[pfitzseb@midgard bin]$ julia <pipe >log.txt 2>err.txt &
[1] 489244
[pfitzseb@midgard bin]$ exec 3>pipe
[pfitzseb@midgard bin]$ echo "1+2" >&3
[pfitzseb@midgard bin]$ echo "X" >&3
[pfitzseb@midgard bin]$ echo "exit()" >&3 
[pfitzseb@midgard bin]$ cat log.txt
3
[1]+  Done                    julia < pipe > log.txt 2> err.txt
[pfitzseb@midgard bin]$ cat err.txt
ERROR: UndefVarError: X not defined