-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using a file instead of stdin works on linux because of nodejs/node#1…
- Loading branch information
1 parent
4d1a95b
commit 91fd4c1
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
#!/bin/bash | ||
|
||
errPath=$(mktemp) | ||
errPath=$(mktemp)_err | ||
inPath=$(mktemp)_in | ||
mkfifo -m 600 "$inPath" | ||
echo $errPath | ||
echo $inPath | ||
|
||
while IFS='$\n' read -r cmd | ||
do | ||
# cleanup eventual error output | ||
rm $errPath | ||
rm -f "$errPath" | ||
eval "$cmd" 2>$errPath | ||
# By printing the status code to stderr, we can establish that th | ||
# code has finished running | ||
exit=$? | ||
# echo "${cmd} ... ${exit}" >&2 | ||
(printf "%x" $exit) >&2 | ||
done < /dev/stdin | ||
|
||
done < "$inPath" |