Skip to content

Commit

Permalink
Reapply "Add support for shebang with arguments"
Browse files Browse the repository at this point in the history
This reverts commit 8c6309c3f5bd3ef8e0ff2a49ef83e998ba8319ec.
  • Loading branch information
gportay committed Jan 30, 2025
1 parent 5d0fad0 commit 3fb6a77
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dosh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ then
shift
set -- -s "$@"
exec "$0" "$@"
elif [ "$__" != "/bin/bash" ] && [ "$__" = "$2" ]
then
echo "Warning: Splitting the single shebang argument into many is not portable!" >&2
echo " Please consider using env(1) and its split option -S instead:" >&2
echo " #!/usr/bin/env -S dosh $*" >&2
read -r -a args <<<"$1"
shift
exec <"$1"
shift
set -- "${args[@]}" -s "$@"
exec "$0" "$@"
fi

set -e
Expand Down

0 comments on commit 3fb6a77

Please sign in to comment.