summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sbang15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/sbang b/bin/sbang
index e71074b330..ed54f7dad7 100755
--- a/bin/sbang
+++ b/bin/sbang
@@ -109,13 +109,20 @@ while read line && ((lines < 2)) ; do
fi
lines=$((lines+1))
done < "$script"
+# this is ineeded for scripts with sbang parameter
+# like ones in intltool
+# #!/<spack-long-path>/perl -w
+# this is the interpreter line with all the parameters as a vector
+interpreter_v=(${interpreter})
+# this is the single interpreter path
+interpreter_f="${interpreter_v[0]}"
# Invoke any interpreter found, or raise an error if none was found.
-if [[ -n "$interpreter" ]]; then
- if [[ "${interpreter##*/}" = "perl" ]]; then
- exec $interpreter -x "$@"
+if [[ -n "$interpreter_f" ]]; then
+ if [[ "${interpreter_f##*/}" = "perl" ]]; then
+ exec $interpreter_v -x "$@"
else
- exec $interpreter "$@"
+ exec $interpreter_v "$@"
fi
else
echo "error: sbang found no interpreter in $script"