[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!
- Re: help with pattern matching needed, (continued)
- Re: help with pattern matching needed, Christoph Anton Mitterer, 2022/01/12
- Re: help with pattern matching needed, Christoph Anton Mitterer, 2022/01/12
- Re: help with pattern matching needed, Lawrence Velázquez, 2022/01/12
- Re: help with pattern matching needed, Christoph Anton Mitterer, 2022/01/12
- Re: help with pattern matching needed, Greg Wooledge, 2022/01/12
- Re: help with pattern matching needed, Christoph Anton Mitterer, 2022/01/12
- Re: help with pattern matching needed,
Greg Wooledge <=
- Re: help with pattern matching needed, Chet Ramey, 2022/01/12
- Re: help with pattern matching needed, Kerin Millar, 2022/01/12