bug-bash
[Top][All Lists]
Advanced

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

Re: History Expansion in Arithmetic Expansion


From: Zachary Santer
Subject: Re: History Expansion in Arithmetic Expansion
Date: Sun, 24 Mar 2024 23:17:11 -0400

On Sat, Mar 23, 2024 at 11:34 AM A4-Tacks <wdsjxhno1001@163.com> wrote:
>
>      ```bash
>      $ ((!RANDOM))
>      bash: !RANDOM: event not found
>      ```

I just reported this last August [1]. If you, like me, never use
history expansion, the best solution might be to disable it in your
.bashrc file:
set +o histexpand
or
set +H
if you hate readability.

$ printf '%s\n' "$(( !RANDOM ))"
0

[1]: https://lists.gnu.org/archive/html/bug-bash/2023-08/msg00016.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]