Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimal/do: allow for relative shebangs #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions minimal/do
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# For the full version, visit http://github.com/apenwarr/redo
#
# The author disclaims copyright to this source file and hereby places it in
# the public domain. (2010 12 14; updated 2019 02 24)
# the public domain. (2010 12 14; updated 2021 08 06)
#
USAGE="
usage: do [-d] [-x] [-v] [-c] <targets...>
Expand Down Expand Up @@ -315,10 +315,10 @@ _run_dofile()
local line1
set -e
read line1 <"$PWD/$dofile" || true
cmd=${line1#"#!/"}
cmd=${line1#"#!"}
if [ "$cmd" != "$line1" ]; then
set -$_do_opt_verbose$_do_opt_exec
exec /$cmd "$PWD/$dofile" "$@"
exec $cmd "$PWD/$dofile" "$@"
else
set -$_do_opt_verbose$_do_opt_exec
# If $dofile is empty, "." might not change $? at
Expand Down