Re: Tilde expansion during command search

2014-08-01 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/1/14, 11:26 AM, Eric Blake wrote: > 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

Re: Tilde expansion during command search

2014-08-01 Thread Eric Blake
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 th

Re: Tilde expansion during command search

2014-08-01 Thread Dan Douglas
On Friday, August 01, 2014 06:20:28 AM Mike Frysinger wrote: > On Wed 23 Jul 2014 08:51:19 Dan Douglas wrote: > > On Wednesday, July 23, 2014 09:28:02 AM you wrote: > > > On 7/23/14, 8:22 AM, Dan Douglas wrote: > > > > Hi, from this discussion: > > > > > > > > https://github.com/koalaman/shellchec

Re: Tilde expansion during command search

2014-08-01 Thread Mike Frysinger
On Wed 23 Jul 2014 08:51:19 Dan Douglas wrote: > On Wednesday, July 23, 2014 09:28:02 AM you wrote: > > On 7/23/14, 8:22 AM, Dan Douglas wrote: > > > Hi, from this discussion: > > > > > > https://github.com/koalaman/shellcheck/issues/195#issuecomment-49678200 > > > > > > I can't find any referenc

Re: Tilde expansion during command search

2014-07-24 Thread Dan Douglas
On Thursday, July 24, 2014 02:34:13 PM lolilolicon wrote: > On Wed, Jul 23, 2014 at 11:00 PM, lolilolicon wrote: > > On Wed, Jul 23, 2014 at 10:43 PM, Eric Blake wrote: > >> But we are talking about the case where ~ IS quoted during > >> the assignment, and only bash then re-expands it during pat

Re: Tilde expansion during command search

2014-07-23 Thread lolilolicon
On Wed, Jul 23, 2014 at 11:00 PM, lolilolicon wrote: > On Wed, Jul 23, 2014 at 10:43 PM, Eric Blake wrote: >> But we are talking about the case where ~ IS quoted during >> the assignment, and only bash then re-expands it during path lookup. > > That's my point. Let me try quoting this again, > >

Re: Tilde expansion during command search

2014-07-23 Thread lolilolicon
On Wed, Jul 23, 2014 at 10:43 PM, Eric Blake wrote: > But we are talking about the case where ~ IS quoted during > the assignment, and only bash then re-expands it during path lookup. That's my point. Let me try quoting this again, Note that the tildes are expanded during the assignment to P

Re: Tilde expansion during command search

2014-07-23 Thread Eric Blake
On 07/23/2014 08:38 AM, Eric Blake wrote: > On 07/23/2014 08:08 AM, lolilolicon wrote: >> >From this page: http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html >> >> Note that the tildes are expanded during the assignment to PATH, not >> when PATH is accessed during command search.

Re: Tilde expansion during command search

2014-07-23 Thread Eric Blake
On 07/23/2014 08:08 AM, lolilolicon wrote: > On Wed, Jul 23, 2014 at 9:58 PM, Eric Blake wrote: >> >> Might be worth asking the POSIX folks if it is allowed by POSIX. What >> do other shells do? > >>From this page: http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html > > Note that th

Re: Tilde expansion during command search

2014-07-23 Thread lolilolicon
On Wed, Jul 23, 2014 at 9:58 PM, Eric Blake wrote: > > Might be worth asking the POSIX folks if it is allowed by POSIX. What > do other shells do? >From this page: http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html Note that the tildes are expanded during the assignment to PATH, no

Re: Tilde expansion during command search

2014-07-23 Thread Dan Douglas
On Wednesday, July 23, 2014 07:58:26 AM Eric Blake wrote: > On 07/23/2014 07:51 AM, Dan Douglas wrote: > > On Wednesday, July 23, 2014 09:28:02 AM you wrote: > >> On 7/23/14, 8:22 AM, Dan Douglas wrote: > >>> Hi, from this discussion: > >>> > >>> https://github.com/koalaman/shellcheck/issues/195#is

Re: Tilde expansion during command search

2014-07-23 Thread Eric Blake
On 07/23/2014 07:51 AM, Dan Douglas wrote: > On Wednesday, July 23, 2014 09:28:02 AM you wrote: >> On 7/23/14, 8:22 AM, Dan Douglas wrote: >>> Hi, from this discussion: >>> >>> https://github.com/koalaman/shellcheck/issues/195#issuecomment-49678200 >>> >>> I can't find any reference that says subst

Re: Tilde expansion during command search

2014-07-23 Thread Dan Douglas
On Wednesday, July 23, 2014 09:28:02 AM you wrote: > On 7/23/14, 8:22 AM, Dan Douglas wrote: > > Hi, from this discussion: > > > > https://github.com/koalaman/shellcheck/issues/195#issuecomment-49678200 > > > > I can't find any reference that says substituting a literal tilde in PATH > > should

Re: Tilde expansion during command search

2014-07-23 Thread Chet Ramey
On 7/23/14, 8:22 AM, Dan Douglas wrote: > Hi, from this discussion: > > https://github.com/koalaman/shellcheck/issues/195#issuecomment-49678200 > > I can't find any reference that says substituting a literal tilde in PATH > should occur during command search. Bash has always done this, even bac

Tilde expansion during command search

2014-07-23 Thread Dan Douglas
Hi, from this discussion: https://github.com/koalaman/shellcheck/issues/195#issuecomment-49678200 I can't find any reference that says substituting a literal tilde in PATH should occur during command search. $ ( cd ~ mkdir tmpdir echo $'#!/bin/sh\necho "Hello from ${BASH_SOURCE}!"'