Skip to content

Commit 02c48a8

Browse files
author
José Valim
committed
Simplify port wrapper script
1 parent 27fefd8 commit 02c48a8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/elixir/lib/port.ex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,15 @@ defmodule Port do
138138
you can wrap the application in a script that checks for stdin. Here is such
139139
script in bash:
140140
141-
#!/bin/bash
142-
name=$1
143-
shift
144-
$name $*
141+
#!/bin/sh
142+
"$@"
145143
pid=$!
146144
while read line ; do
147145
:
148-
done < /dev/stdin
146+
done
149147
kill -KILL $pid
150148
149+
151150
Now instead of:
152151
153152
Port.open({:spawn_executable, "/path/to/program"},

0 commit comments

Comments
 (0)