summaryrefslogtreecommitdiff
path: root/bin/sbang
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@informatik.uni-hamburg.de>2020-01-16 10:34:02 +0100
committerPeter Scheibel <scheibel1@llnl.gov>2020-01-24 17:06:51 -0800
commit95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5 (patch)
treed0c9e7178395835b91197e4ffcf84a0361880079 /bin/sbang
parent33d35768e63b225434ec090fbe419115e616d6b1 (diff)
downloadspack-95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5.tar.gz
spack-95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5.tar.bz2
spack-95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5.tar.xz
spack-95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5.zip
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.
Diffstat (limited to 'bin/sbang')
-rwxr-xr-xbin/sbang6
1 files 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"