mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Use the full path for noshebang'd scripts
If you make a script called `foo` somewhere in $PATH, and did not give
it a shebang, this would end up calling
sh foo
instead of
sh /usr/bin/foo
which might not match up.
Especially if the path is e.g. `--version` or `-` that would end up
being misinterpreted *by sh*.
So instead we simply pass the actual_cmd to sh, because we need it
anyway to get it to fail to execute before.
This commit is contained in:
@@ -80,3 +80,13 @@ runfile
|
||||
|
||||
#CHECK: 126
|
||||
#CHECKERR: exec: {{.*}}
|
||||
|
||||
echo 'echo foo' >./-
|
||||
sleep 0.1
|
||||
chmod +x ./-
|
||||
set PATH ./ $PATH
|
||||
sleep 0.1
|
||||
-
|
||||
#CHECK: foo
|
||||
echo $status
|
||||
#CHECK: 0
|
||||
|
||||
Reference in New Issue
Block a user