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


Groups > linux.debian.user > #257458

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

From Max Nikulin <manikulin@gmail.com>
Newsgroups linux.debian.user
Subject Re: Bookworm: dash shell globs don't recognise [^...] to negate a character class
Date 2023-04-21 09:10 +0200
Message-ID <GmT45-3sV2-1@gated-at.bofh.it> (permalink)
References (8 earlier) <GkNm9-2c4r-9@gated-at.bofh.it> <Gl1S9-2kUr-1@gated-at.bofh.it> <GlUvf-2Sdu-1@gated-at.bofh.it> <Gmdod-33ID-7@gated-at.bofh.it> <Gmmrv-397t-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.debian.user | Previous | NextPrevious 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