From 95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 16 Jan 2020 10:34:02 +0100 Subject: [PATCH] sbang: Fix perl binary detection The perl binary can also be called `perlX.Y.Z` if using a development build or simply using the versioned binary. We were also dropping all sbang arguments, since `exec $interpreter_v` was only using the first element of the `interpreter_v` array. --- bin/sbang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/sbang b/bin/sbang index 6ceff42e66..5c9ad37acd 100755 --- a/bin/sbang +++ b/bin/sbang @@ -103,10 +103,10 @@ interpreter_f="${interpreter_v[0]}" # Invoke any interpreter found, or raise an error if none was found. if [[ -n "$interpreter_f" ]]; then - if [[ "${interpreter_f##*/}" = "perl" ]]; then - exec $interpreter_v -x "$@" + if [[ "${interpreter_f##*/}" = "perl"* ]]; then + exec $interpreter -x "$@" else - exec $interpreter_v "$@" + exec $interpreter "$@" fi else echo "error: sbang found no interpreter in $script"