Re: Tilde expansion during command search
On Wed, Jul 23, 2014 at 11:00 PM, lolilolicon loliloli...@gmail.com wrote: On Wed, Jul 23, 2014 at 10:43 PM, Eric Blake ebl...@redhat.com 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 PATH, _not when PATH is accessed during command search._ in which I was trying to imply that, Bash *does* expand the tildes _when PATH is accessed during command search._ I'm sorry if it felt like I was taking that sentence out of context. Well, I was; but I think it's fair to assume that whoever wrote that sentence would agree that tilde expansion should not be performed when PATH is accessed during command search. If the tilde were escaped when the PATH were assigned, should we give the tilde a second chance and expand it when the PATH were accessed? To which POSIX would probably say, Hell no. We're reluctant enough to allow tilde expansion in assignments already! How reluctant? If you look at the spec[1], you will see things like: Tilde expansion generally occurs only at the beginning of words, but an exception based on _historical practice_ has been included: and more directly Consideration was given to prohibiting this behaviour because any of the following are reasonable substitutes: So, has anyone asked the POSIX people about this? [1] http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html#tag_001_006_001
Re: Tilde expansion during command search
On Thursday, July 24, 2014 02:34:13 PM lolilolicon wrote: On Wed, Jul 23, 2014 at 11:00 PM, lolilolicon loliloli...@gmail.com wrote: On Wed, Jul 23, 2014 at 10:43 PM, Eric Blake ebl...@redhat.com 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 PATH, _not when PATH is accessed during command search._ in which I was trying to imply that, Bash *does* expand the tildes _when PATH is accessed during command search._ I'm sorry if it felt like I was taking that sentence out of context. Well, I was; but I think it's fair to assume that whoever wrote that sentence would agree that tilde expansion should not be performed when PATH is accessed during command search. The section you quoted isn't present at all in issue 7. The current version of the spec makes tilde expansion within assignments mandatory, including multiple tilde expansions when there are colons. The part that describes how that works moved to XRAT section 2.6.1. However the part that refers to what happens during command search appears to have been removed. I agree that if the quoted sentence were present it would probably imply that this behavior is explicitly disallowed. -- Dan Douglas
Re: HERE document failed Re: /dev/fd/62: No such file or directory
Chet Ramey wrote: Only you can answer questions about where your scripts, and your `system scripts', use process substitution. I tried to switch to in-line HERE documents instead of /dev/fd/62... but those don't work either. I thought HERE docs were pretty basic? Are HERE documents also an optional feature that are not included in POSIX? Thanks...