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


Groups > linux.debian.user > #257133 > unrolled thread

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

Started byDavid <bouncingcats@gmail.com>
First post2023-04-13 02:20 +0200
Last post2023-04-21 09:10 +0200
Articles 4 on this page of 24 — 9 participants

Back to article view | Back to linux.debian.user


Contents

  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

Page 2 of 2 — ← Prev page 1 [2]


#257393

FromMax Nikulin <manikulin@gmail.com>
Date2023-04-19 12:40 +0200
Message-ID<Gmdod-33ID-7@gated-at.bofh.it>
In reply to#257355
On 18/04/2023 21:19, Vincent Lefevre wrote:
> BTW, history expansion can be very useful, but IMHO, this should
> have been interactive and triggered by control characters or
> escape sequences, not by "normal" characters.

It would be great. Unfortunately disabling histexpand option in bash 
blocks the M-^ shortcut as well.

shopt -s histverify

allows at least to confirm that expansion result is expected.

[toc] | [prev] | [next] | [standalone]


#257401

Fromdavidson <davidson@freevolt.org>
Date2023-04-19 22:20 +0200
Message-ID<Gmmrv-397t-1@gated-at.bofh.it>
In reply to#257393
On Wed, 19 Apr 2023 Max Nikulin wrote:
> On 18/04/2023 21:19, Vincent Lefevre wrote:
>> BTW, history expansion can be very useful, but IMHO, this should
>> have been interactive and triggered by control characters or
>> escape sequences, not by "normal" characters.
>
> It would be great. Unfortunately disabling histexpand option in bash blocks 
> the M-^ shortcut as well.
>
> shopt -s histverify
>
> allows at least to confirm that expansion result is expected.

There is also the 'p' (print) word designator, that prints the
expansion but does not execute it. Used like so:

  $ !.:p # See what the history expansion for 'dot' is
  . .bash_functions/manterm

This places the expansion in history as last command, so up-arrow +
return will now execute it.

-- 
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin

[toc] | [prev] | [next] | [standalone]


#257402

Fromdavidson <davidson@freevolt.org>
Date2023-04-19 22:30 +0200
Message-ID<GmmBc-39aG-9@gated-at.bofh.it>
In reply to#257401
On Wed, 19 Apr 2023 davidson wrote:
> On Wed, 19 Apr 2023 Max Nikulin wrote:
>> On 18/04/2023 21:19, Vincent Lefevre wrote:
>>> BTW, history expansion can be very useful, but IMHO, this should
>>> have been interactive and triggered by control characters or
>>> escape sequences, not by "normal" characters.
>> 
>> It would be great. Unfortunately disabling histexpand option in bash blocks 
>> the M-^ shortcut as well.
>> 
>> shopt -s histverify
>> 
>> allows at least to confirm that expansion result is expected.
>
> There is also the 'p' (print) word designator, that prints the

Sorry. Not a "word designator", but a "modifier". (Modifiers follow
word designator, if any).

> expansion but does not execute it. Used like so:
>
> $ !.:p # See what the history expansion for 'dot' is
> . .bash_functions/manterm
>
> This places the expansion in history as last command, so up-arrow +
> return will now execute it.
>
>

-- 
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin

[toc] | [prev] | [next] | [standalone]


#257458

FromMax Nikulin <manikulin@gmail.com>
Date2023-04-21 09:10 +0200
Message-ID<GmT45-3sV2-1@gated-at.bofh.it>
In reply to#257401
On 20/04/2023 03:18, davidson wrote:
> On Wed, 19 Apr 2023 Max Nikulin wrote:
>> On 18/04/2023 21:19, Vincent Lefevre wrote:
>>> BTW, history expansion can be very useful, but IMHO, this should
>>> have been interactive and triggered by control characters or
>>> escape sequences, not by "normal" characters.
>>
>> It would be great. Unfortunately disabling histexpand option in bash 
>> blocks the M-^ shortcut as well.
>>
>> shopt -s histverify
>>
>> allows at least to confirm that expansion result is expected.
> 
> There is also the 'p' (print) modifier, that prints the

I corrected the line above basing on your another message.

> expansion but does not execute it. Used like so:
> 
>   $ !.:p # See what the history expansion for 'dot' is
>   . .bash_functions/manterm
> 
> This places the expansion in history as last command, so up-arrow +
> return will now execute it.

It is nice to have such feature. Likely you actively use history 
expansion, while I prefer interactive approach: search (C-r), edit, 
including yank-last-arg (M-.), perhaps operate-and-get-next (C-o). I 
find it safer even if it is not so fast.

Unfortunately :p modifier does not prevent unexpected history expansion, 
e.g. when a file name contains "!". That is why I would prefer to 
suppress history expansion for every typed command, but still have 
possibility to perform expansion on request (M-^ or similar shortcut), 
perhaps limiting it to a single "!" before cursor.

histverify is a means to cancel command if unsolicited expansion or 
unexpected result noticed.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.debian.user


csiph-web