Closed johanatan closed 5 years ago
Here is a workaround:
#!/bin/bash
tmppipe=$(mktemp -u)
mkfifo -m 600 "$tmppipe"
closh < "$tmppipe" & > 1
closh_pid=$!
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "$line" > "$tmppipe";
done < "$1"
wait $closh_pid
Use it like so:
$ jclosh.sh repro.cljs
Thanks for the repro. Could you explain what is the principle behind the workaround? It seems it feeds the input via fifo pipe. What is the difference from the plain file redirection?
Line-by-line rather than all at once. I have no idea why this would matter but it does.
Initial iteration of script mode has now landed in the latest JVM version release v0.4, you can read how to use it in the scripting docs.
repro.cljs
repro.sh
Running
repro.sh
blows up on therm -f (str target-name)
line. Any reference totarget-name
or to(getenv "JAR")
there will cause the same blowup.Also a simple
ls
after a reference to eithertarget-name
or(getenv "JAR")
will cause the same.The program exits with a success code of 0 (and the lines after blow up do not execute).