On 7/30/20 10:43 AM, Robert Elz wrote:
>     Date:        Mon, 20 Jul 2020 10:11:59 -0400
>     From:        Chet Ramey <chet.ra...@case.edu>
>     Message-ID:  <a62804af-8c7f-5191-362b-ef5f4d7b3...@case.edu>
> 
> Sorry, didn't reply to this at the time...
> 
>   | You can make a case for the bash/ksh tilde expansion: the word
>   | expansion is ${PARAM:=WORD}, and the WORD is subject to tilde expansion
>   | according to the enumerated list in 2.6.2.
> 
> Sure. but ...
> 
>   | Since the first character of WORD is a tilde, if you say the
>   | tilde-prefix stops at the `:',
> 
> but that's true (in posix) only in an assignment.   Either it is an
> assignment, or it is not. 

It's not an assignment. Not according to the POSIX definition of a variable
assignment.

The terminating the tilde prefix at `:' is a bash extension. POSIX allows
it because the behavior is undefined if the tilde prefix doesn't form a
valid login name. Call it a bug if you like, but it's been there since at
least bash-1.10.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to