[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master d023be6: Make an error message less cryptic

From: Greg Chicares
Subject: [lmi-commits] [lmi] master d023be6: Make an error message less cryptic
Date: Fri, 18 Dec 2020 15:48:12 -0500 (EST)

branch: master
commit d023be6b2b2602ac69936c44e3707727759aa0f5
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Make an error message less cryptic
    Using msw tools can easily cause any file's executable bit to be set.
    An "unknown shebang" message doesn't make much sense in that case.
 check_script.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/check_script.sh b/check_script.sh
index 72ec429..0616b8a 100755
--- a/check_script.sh
+++ b/check_script.sh
@@ -63,5 +63,12 @@ case $shebang  in
     ("#!/usr/bin/make") ;;
     ("#!/bin/sed") ;;
-    (*) printf '%s\n' "unknown shebang $shebang in file $1" ;;
+    (*)
+        printf '%s\n' "file $1 is executable, but should it be?"
+        printf '%s\n' "if it's a script, then its shebang"
+        printf '%s\n' "  $shebang"
+        printf '%s\n' "is unknown; otherwise, consider running"
+        printf '%s\n' "  chmod -x $1"
+        printf '%s\n' "to remove the executable bit"
+    ;;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]