Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16848

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

From Bruce Lilly <bruce.lilly@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Bash parameter expansion (remove largest trailing match, remove largest leading match, pattern replacement) does not work
Date 2020-08-29 14:55 -0400
Message-ID <mailman.1723.1598727342.2469.bug-bash@gnu.org> (permalink)
References <CAPyES363zNvUZHWo6imXOyC3UPU5FAbsyFGzWkcJMO-HBhT6gQ@mail.gmail.com> <CAFLRLk_k+J3-Nt9UJ4Fb8c-RewPnVjf_b=ShqGGASG0GmREAhg@mail.gmail.com> <CAPyES3685SjyZfrL+M_56wGqxvh=N9xNchWJ1xqMSrmmEJb9ww@mail.gmail.com>

Show all headers | View raw


Please don't assume that something output by printf (without quoting) for
clarity is representative of actual expansion by the shell when properly
quoted.

On Sat, Aug 29, 2020, 14:52 Koichi Murase <myoga.murase@gmail.com> wrote:

> 2020-08-29 23:47 Bruce Lilly <bruce.lilly@gmail.com>:
> > Description:
> >         Bash parameter expansion (remove largest trailing match,
> > remove largest leading match, pattern replacement) does not work
>
> In short, (1) ``octal escape \057'' doesn't have special meaning in
> Bash glob patterns.  `[\057]' means just one of a literal backslash or
> digits 0, 5, or 7.  (2) You need to set `shopt -s extglob` to use
> extended glob patterns like `+(...)' and `*(...)'.  Please look at the
> paragraph above the list of extended patterns in the manual.
>
> --
> Koichi
>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

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 14:55 -0400

csiph-web