On Sat, Jul 01, 2023 at 01:05:46PM +0200, alex xmb ratchev wrote:
> > tried:
> > $ shopt -s extglob globstar
> >
> > $ rm *.BAR !(FOO.BAR)
> >
> > not work, it wiped all! Help!
That's because *.BAR matches all of them, and then !(FOO.BAR) matches
all but one. So you passed all but FOO.BAR twice, and FOO.BAR once.
> shopt -s extglob dotglob
>
> rm !(FOO.BAR)
This is the correct answer.