Re: [feature] tilde expansion on arbitrary arguments ending in unquoted =~

2017-03-09 Thread Martijn Dekker
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 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.



Re: [feature] tilde expansion on arbitrary arguments ending in unquoted =~

2017-03-09 Thread 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 ksh88 and/or ksh93) has historically enabled tilde expansion
after an unquoted (at least I hope!) equals sign, 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…

bye,
//mirabilos
-- 
> emacs als auch vi zum Kotzen finde (joe rules) und pine für den einzig
> bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)
Hallo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls
... pine-User, und das auch noch gewohnheitsmäßig ("Oooohhh").  [aus dasr]