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

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



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: