Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #257137

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

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Bookworm: dash shell globs don't recognise [^...] to negate a character class
Date 2023-04-13 03:10 +0200
Message-ID <GjTDj-1Edp-3@gated-at.bofh.it> (permalink)
References <GjSQV-1DIB-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 13, 2023 at 12:12:23AM +0000, David wrote:
> $ echo [^0-9]*
> 11 22           <------ new behaviour by dash

The [^chars] syntax is a negation in Basic and Extended Regular
Expressions, and in bash's globs (it's a bash extension), but NOT in
POSIX globs.

The correct negation syntax in POSIX sh globs is [!chars].

This goes all the way back to the original Bourne shell, where the ^
character was a synonym for | (pipe), because many terminals did not
have a | character.  Due to the way sh parses commands, using ^ in
globs would have caused problems.  That's why sh uses [!chars].

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bookworm: dash shell globs don't recognise [^...] to negate a  character class David <bouncingcats@gmail.com> - 2023-04-13 02:20 +0200
  Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Jude DaShiell <jdashiel@panix.com> - 2023-04-13 02:30 +0200
    Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Jude DaShiell <jdashiel@panix.com> - 2023-04-13 02:40 +0200
  Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-13 03:10 +0200
    Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Vincent Lefevre <vincent@vinc17.net> - 2023-04-13 17:00 +0200
    Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-14 04:10 +0200
      Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-14 04:40 +0200
        Re: Bookworm: dash shell globs don't recognise [^...] to negate a character class rhkramer@gmail.com - 2023-04-14 18:10 +0200
          Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-14 19:00 +0200
          Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class David Wright <deblis@lionunicorn.co.uk> - 2023-04-15 00:30 +0200
        Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-15 04:50 +0200
          Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-15 05:10 +0200
            Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class <tomas@tuxteam.de> - 2023-04-15 07:10 +0200
              Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-15 08:20 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class <tomas@tuxteam.de> - 2023-04-15 09:40 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class davidson <davidson@freevolt.org> - 2023-04-15 13:10 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-15 14:40 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-16 06:10 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Vincent Lefevre <vincent@vinc17.net> - 2023-04-18 16:30 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Greg Wooledge <greg@wooledge.org> - 2023-04-18 16:40 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-19 12:40 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class davidson <davidson@freevolt.org> - 2023-04-19 22:20 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class davidson <davidson@freevolt.org> - 2023-04-19 22:30 +0200
                Re: Bookworm: dash shell globs don't recognise [^...] to negate a  character class Max Nikulin <manikulin@gmail.com> - 2023-04-21 09:10 +0200

csiph-web