diff options
author | Michael Kuhn <michael.kuhn@informatik.uni-hamburg.de> | 2020-01-16 10:34:02 +0100 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2020-01-24 17:06:51 -0800 |
commit | 95ddd3d6f2f2ae14127bcaac9e92456a7a5bfda5 (patch) | |
tree | d0c9e7178395835b91197e4ffcf84a0361880079 | |
parent | 33d35768e63b225434ec090fbe419115e616d6b1 (diff) | |
download | spack-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.
-rwxr-xr-x | bin/sbang | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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" |