Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16856 > unrolled thread

Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

Started byBruce Lilly <bruce.lilly@gmail.com>
First post2020-08-29 16:07 -0400
Last post2020-08-29 16:07 -0400
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.


Contents

  Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work Bruce Lilly <bruce.lilly@gmail.com> - 2020-08-29 16:07 -0400

#16856 — Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work

FromBruce Lilly <bruce.lilly@gmail.com>
Date2020-08-29 16:07 -0400
SubjectRe: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work
Message-ID<mailman.1736.1598731677.2469.bug-bash@gnu.org>
On Sat, Aug 29, 2020, 15:27 Koichi Murase <myoga.murase@gmail.com> wrote:

>  I assumed that you have written like
>
>   separator2='\057'
>   pattern1="${number1}(${separator1})"
>
> because otherwise, it doesn't work with ksh93 either.
>
You are correct.

To explain it in more detail, first, these parameter expansions work
> for me with separator1='/'.  The pattern that you constructed from
> separator2='\057' is just not supported by Bash.

That's surprising, as octal and hexadecimal escapes are fairly common.

  Next, you specify
> exactly the same script `shellbug' to both Bash and ksh93, so I could
> assume that you are missing the Bash-specific `shopt -s extglob' in
> the script because otherwise, ksh93 would have complained it.  That is
> all what I can guess from your original post.
>
Yes, I'm still looking into that (along with updating a couple of FreeBSD
machines, eating lunch, and monitoring a couple of downloads).  I'll
obviously have to wrap the "shopt" bit in a wrapper; is there some minimum
bash version that supports it?

>
>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web