On Sat, Mar 23, 2024 at 11:34 AM A4-Tacks <wdsjxhno1...@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