[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bookworm: dash shell globs don't recognise [^...] to negate a character class



Something else I've noticed with bash.
Those work when run in mate-terminal but not in console for some strange
reason.


-- Jude <jdashiel at panix dot com> "There are four boxes to be used in
defense of liberty: soap, ballot, jury, and ammo. Please use in that
order." Ed Howdershelt 1940.

On Wed, 12 Apr 2023, Jude DaShiell wrote:

> When I write bash scripts and I've done this for several debian versions I
> use:
> #!/usr/bin/env bash
> That has worked in the past.
>
>
> -- Jude <jdashiel at panix dot com> "There are four boxes to be used in
> defense of liberty: soap, ballot, jury, and ammo. Please use in that
> order." Ed Howdershelt 1940.
>
> On Thu, 13 Apr 2023, David wrote:
>
> > In Debian, shell scripts that have
> > #!/usr/bin/sh
> > as the first line are executed by the 'dash' shell.
> >
> > If you write such scripts, you might be interested
> > to know that 'dash' currently has a behaviour
> > change in Debian version 12 Bookworm compared to
> > Debian version 11 Bullseye.
> >
> > This is being discussed at
> >   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028002
> >
> > Below is a demo of the change which shows an
> > example of possible consequences.
> >
> > In Debian version 11 Bullseye,
> > Bash and 'dash' behave the same:
> > $ cat /etc/debian_version
> > 11.6
> > $ mkdir eek
> > $ cd eek
> > $ touch aa bb 11 22
> > $ bash
> > $ echo [!0-9]*
> > aa bb
> > $ echo [^0-9]*
> > aa bb
> > $ sh
> > $ echo [!0-9]*
> > aa bb
> > $ echo [^0-9]*
> > aa bb
> >
> > In Debian version 12 Bookworm,
> > Bash and 'dash' behave differently:
> > $ cat /etc/debian_version
> > 12.0
> > $ mkdir eek
> > $ cd eek
> > $ touch aa bb 11 22
> > $ bash
> > $ echo [!0-9]*
> > aa bb
> > $ echo [^0-9]*
> > aa bb
> > $ sh
> > $ echo [!0-9]*
> > aa bb
> > $ echo [^0-9]*
> > 11 22           <------ new behaviour by dash
> >
> >
>
>


Reply to: