Skip to content
Snippets Groups Projects
Commit 95ddd3d6 authored by Michael Kuhn's avatar Michael Kuhn Committed by Peter Scheibel
Browse files

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.
parent 33d35768
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment