The history expansion code can end up reading past the end of the
input line buffer if the line ends with an invalid multibyte sequence:
bash --norc -in <<<$'X\n\e238Y!!\xC2\xC2'
ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 1 at 0x000108b48400 thread T0
#0 0x104ed9c88 in history_
greets ..
On Sun, 23 Apr 2023, 10:23 pm Rob Liversage,
wrote:
> Apologies. Please ignore. I realized I was a bit hasty.
>
> On Sun, Apr 23, 2023 at 8:18 PM Rob Liversage
> wrote:
>
> > Hello
> >
> > At:
> >
> https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expan
Apologies. Please ignore. I realized I was a bit hasty.
On Sun, Apr 23, 2023 at 8:18 PM Rob Liversage
wrote:
> Hello
>
> At:
> https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion
> 3.5.3 Shell Parameter Expansion
> The example:
>
> $ v=123
> $ echo ${v-unse
Hello
At:
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion
3.5.3 Shell Parameter Expansion
The example:
$ v=123
$ echo ${v-unset}
123
Should be:
$ v=123
$ echo ${v*:*-unset}
123
Kind regards
Robert
Bash has a history function, it would be useful if 'history' would show the
exit codes (return codes) from all commands:
For example, showing the RC values in a new column after the history number
4751 0 2023-04-10 04:49:48 cat kernel-vanilla.repo
4752 0 2023-04-10 04:50:30 rm kernel-vanilla.re