Op 09-03-17 om 16:50 schreef Thorsten Glaser:
> Martijn Dekker dixit:
> 
>> Then the documentation is not consistent with the intended behaviour. If
>> it's intended that any argument ending in an unquoted sequence =~, given
>> to any command, is subject to tilde expansion, the documentation should
>> describe exactly that behaviour.
> 
> Good point. I’ll update the manpage to be more explicit.
> 
> The Korn Shell (although I’ve not recherched whether this also applies
> to AT&T ksh88 and/or ksh93)

I checked both of these yesterday, and neither of them do this; it
appears to be a pdksh-ism only.

>  has historically enabled tilde expansion
> after an unquoted (at least I hope!) equals sign,

Yes, I verified it only happens if both the = and the ~ are unquoted.

>  and tab completion
> also after an unquoted colon.
> 
> I’ll try to put that into manpage wording RSN.
> 
> Do note that tilde stuff has become more expand-y recently due to a
> change for better POSIX conformance, too. See:
> 
> http://www.mirbsd.org/cvs.cgi/src/bin/mksh/dot.mkshrc.diff?r1=1.102;r2=1.103
> 
> I wonder what POSIX has to say about your tilde issue…

The tilde expansion spec is here:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_01

For assignments (not including arguments to 'typeset' and the like that
may look like assignments but for the purposes of shell grammar are no
such thing), tildes following the '=' and any ':' are expanded.
Presumably this is to allow for things like
    PATH=~/bin:~/sbin:...

For non-assignment arguments (which would include arguments to 'export',
'typeset' and the like that may look like assignments but for the
purposes of shell grammar are no such thing), tilde expansion is only
provided for at the beginning of each argument (meaning, it's not
provided for at all in those assignment-like arguments).

- M.

Reply via email to