On 2/16/19 11:38 AM, [email protected] wrote:
> I would like to include a null string as part of a parameter expansion word:
>
>> mapfile -t${bNullDelimited+d ''}
>
> When bNullDelimited is set, I expect this to expand to:
>
>> mapfile -td ''
>
> However, it expands to:
>
>> mapfile -td
There are mixed behaviors. The idea behind the bash behavior is that a
null string added to a non-empty word is simply discarded, and this happens
while the word after the `+' is being processed, before word splitting.
bash/ksh93/zsh do it one way, ash-derived shells/mksh/yash do it another.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/