summaryrefslogtreecommitdiff
path: root/bin/sbang
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sbang')
-rwxr-xr-xbin/sbang8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/sbang b/bin/sbang
index 1ea5f06592..e71074b330 100755
--- a/bin/sbang
+++ b/bin/sbang
@@ -111,8 +111,12 @@ while read line && ((lines < 2)) ; do
done < "$script"
# Invoke any interpreter found, or raise an error if none was found.
-if [ -n "$interpreter" ]; then
- exec $interpreter "$@"
+if [[ -n "$interpreter" ]]; then
+ if [[ "${interpreter##*/}" = "perl" ]]; then
+ exec $interpreter -x "$@"
+ else
+ exec $interpreter "$@"
+ fi
else
echo "error: sbang found no interpreter in $script"
exit 1