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

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



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.


Reply to: