Opened 10 years ago

Closed 9 years ago

#42 closed defect (fixed)

ash: Search for script interpreter in PATH

Reported by: dmik Owned by:
Priority: major Milestone:
Component: shell Version:
Severity: Keywords:
Cc:

Description (last modified by dmik)

ash doesn't currently search for the interpreter specified with the !# magic in PATH (as kLIBC spawnvp does). See comment:1 for more info.

Change History (5)

comment:1 Changed 10 years ago by dmik

There is at least one problem that I want to fix: ash doesn't currently search for the interpreter specified with the !# magic in PATH (as kLIBC spawnvp does). As a result, the following script t.pl:

#!/usr/bin/perl

print "Hello"

will give the following error when run from a shell script or by sh.exe directly (via the -c option):

D:>sh -c ./t.pl
./t.pl: /usr/bin/perl: not found

As opposed to that, spawnvp will search for perl in PATH if it finds out that /usr/bin/perl doesn't exist.

comment:2 Changed 10 years ago by Silvan Scherrer

This also refers to #26 and #27

Last edited 10 years ago by Silvan Scherrer (previous) (diff)

comment:3 Changed 10 years ago by dmik

Description: modified (diff)
Summary: ash: Bring to portsash: Search for script interpreter in PATH
Type: taskdefect

Yes, #26 is already about bringing it to ports. So I changed the subject of this ticket to be an ASH defect then. And we need #26 to be done before resolving this one.

comment:4 Changed 9 years ago by Silvan Scherrer

Component: *noneshell

comment:5 Changed 9 years ago by dmik

Resolution: fixed
Status: newclosed

This problem is fixed by switching from NetBSD ash to Debian dash (see http://trac.netlabs.org/ports/ticket/26#comment:11 for more details). I performed the above perl test and it works nicely with dash.

Note: See TracTickets for help on using tickets.