Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15539
| From | Oğuz <oguzismailuysal@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Parameter expansion resulting empty treated as if it's not empty |
| Date | 2019-10-30 14:14 +0300 |
| Message-ID | <mailman.45.1572434100.22196.bug-bash@gnu.org> (permalink) |
| References | <CAH7i3Lp79s5Kpe+kg6thQtqpaVai19HMoDW1SXNF9Ae71p7HGQ@mail.gmail.com> <CAH7i3Loshnfd7y_MLhRbPmhBVvwWoPBj3g8c-3zcyL2+duqoKQ@mail.gmail.com> |
First two command lines lack "echo", sorry
On Wed, Oct 30, 2019 at 2:12 PM Oğuz <oguzismailuysal@gmail.com> 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.
>
> Other shells I could find don't have this problem
>
> $ sh -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ ash -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ dash -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ ksh -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ yash -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ zsh -c 'echo "${1##*"${1##*}"}"' _ bar
>
> $ bash -c 'echo "${1##*"${1##*}"}"' _ bar
> bar
> $ bash --posix -c 'echo "${1##*"${1##*}"}"' _ bar
> bar
>
> Is this a bug?
>
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Parameter expansion resulting empty treated as if it's not empty Oğuz <oguzismailuysal@gmail.com> - 2019-10-30 14:14 +0300
csiph-web