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.mur...@gmail.com> wrote: > 2020-08-29 23:47 Bruce Lilly <bruce.li...@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 >