Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15539 > unrolled thread
| Started by | Oğuz <oguzismailuysal@gmail.com> |
|---|---|
| First post | 2019-10-30 14:14 +0300 |
| Last post | 2019-10-30 14:14 +0300 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Parameter expansion resulting empty treated as if it's not empty Oğuz <oguzismailuysal@gmail.com> - 2019-10-30 14:14 +0300
| From | Oğuz <oguzismailuysal@gmail.com> |
|---|---|
| Date | 2019-10-30 14:14 +0300 |
| Subject | Re: Parameter expansion resulting empty treated as if it's not empty |
| Message-ID | <mailman.45.1572434100.22196.bug-bash@gnu.org> |
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 top | Article view | gnu.bash.bug
csiph-web