On 08/01/2014 07:53 AM, Dan Douglas wrote: >> how so ? execvp doesn't do tilde expansion. only the shell does. > > That's the problem. A program using execvp should be able to expect the same > result as that of the shell for a given PATH value. Because of this, it > can't, unless exec has the same implementation. > >> and it does it once at assignment. > > The example from my first post demonstrates that Bash substitutes a literal > tilde in PATH during the actual path search before executing a command, in > addition to during assignments and word expansions.
And that bash is the odd one out in comparison to all other shells. I think bash is buggy for performing tilde expansion during PATH lookup for literal tildes contained in PATH, because no other shell does it, and POSIX does not specify that it would happen. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature