From 29b78bf0dd8b9f6657a1c081ea6aa47120f469ea Mon Sep 17 00:00:00 2001 From: Ryan Jacobs Date: Sat, 16 Sep 2023 17:56:33 -0700 Subject: [PATCH] fix: if $bin DNE, do not execute E.g. gcc produces no output because `c --version` was run --- c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/c b/c index 2d849ef..3621cb9 100755 --- a/c +++ b/c @@ -155,9 +155,14 @@ binname="$tmproot/$id.bin" run() { trap cleanup SIGINT - shift - (exec -a "$fname" "$binname" "$@") - ret=$? + if [ -x "$binname" ]; then + shift + (exec -a "$fname" "$binname" "$@") + ret=$? + else + echo + ret=4 + fi trap - SIGINT cleanup