[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parameter expansion resulting empty treated as if it's not empty
From: |
Chet Ramey |
Subject: |
Re: Parameter expansion resulting empty treated as if it's not empty |
Date: |
Wed, 30 Oct 2019 18:45:10 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 10/30/19 7:12 AM, Oğuz wrote:
> Since
>
> bash -c '${1##*""}' _ foo
>
> prints an empty line, I was expecting
>
> bash -c '${1##*"${1##*}"}' _ foo
>
> to print an empty line too, but instead it prints foo.
Thanks for the report. The shell doesn't handle the second quoted string
correctly. I'll fix it for the next devel branch push.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/