help-bash
[Top][All Lists]
Advanced

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

Re: help with pattern matching needed


From: Greg Wooledge
Subject: Re: help with pattern matching needed
Date: Wed, 12 Jan 2022 10:28:30 -0500

On Wed, Jan 12, 2022 at 03:36:05PM +0100, Christoph Anton Mitterer wrote:
> On Wed, 2022-01-12 at 07:38 -0500, Greg Wooledge wrote:
> > Presumably your system is using one of the older versions of dash. 
> 
> Well my original tests were all with Debian sid's:
> bash           5.1
> busybox        1.30.1
> dash           0.5.11+git20210903+057cd650a4ed
> klibc-utils    2.0.10

Debian 11 has dash version 0.5.11+git20200708+dd9ef66-5 -- maybe the
behavior changed again?  This happens a lot in shells.

unicorn:~$ dash
$ case a in [^.a]) echo match;; *) echo not;; esac
not
$ case a in ['^.a']) echo match;; *) echo not;; esac
not
$ case a in [!.a]) echo match;; *) echo not;; esac
not
$ case a in ['!.a']) echo match;; *) echo not;; esac
match

Aha, so the quotes *do* matter... sometimes!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]