Re: [PATCH v2] exec: Print absolute paths for command location queries
Harald van Dijk <[email protected]> Sat, 13 Jun 2026 03:37:14 +0100
| Newsgroups | org.kernel.vger.dash |
|---|---|
| Message-ID | <[email protected]> |
On 6/13/26 03:32, Herbert Xu wrote: > On Sat, Jun 13, 2026 at 03:09:49AM +0100, Harald van Dijk wrote: >> >> Oh, I see. Currently, dash never converts paths to absolute. The patch >> changes it to do so whenever possible, both for the case where commands are >> looked up from PATH (which is required by POSIX) and the case where they >> aren't (where I think POSIX is ambiguous). Other shells (ksh, yash) do print >> an absolute path in all cases, but matching bash sounds reasonable too. > > Reading the standard again it seems that bash might actually be > in the wrong here, as it specifically refers to "command_names > including a <slash>". > > Since that precludes a PATH search, it is self-contradictory. I'll > wait for the standard (or bash) to be fixed before taking this change. Huh. Good point. That would make the interpretation that matches what the patch does almost certainly the intended interpretation, but it would be nice if the standard actually said so. Cheers, Harald van Dijk