[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
history -s from inside function replaces last command rather than adding
From: |
Bug Maybefound |
Subject: |
history -s from inside function replaces last command rather than adding to it |
Date: |
Fri, 13 Dec 2024 23:03:58 +0000 |
User-agent: |
eM_Client/10.0.3530.0 |
Configuration Information [Automatically generated, do not change]:
Machine: aarch64
OS: darwin21.6.0
Compiler: clang
Compilation CFLAGS: -DSSH_SOURCE_BASHRC
-DDEFAULT_LOADABLE_BUILTINS_PATH='/opt/homebrew/Cellar/bash/5.2.37/lib/b$
uname output: Darwin mini.home 21.6.0 Darwin Kernel Version 21.6.0: Fri Sep 15
16:17:13 PDT 2023; root:xnu-8020.$
Machine Type: aarch64-apple-darwin21.6.0
Bash Version: 5.2
Patch Level: 37
Release Status: release
Description:
If I make a function that does history -s whatever, that seems to be put
in the history instead of the function call rather than along with it.
Repeat-By:
foo() { echo foo; history -s bar; }
Then type foo then up arrow a couple times. I would expect bar then foo.
I have to do this to have both in the history: foo() { echo foo;
history -s foo "$@"; history -s bar; }
Is this working as intended?
Thanks!
- history -s from inside function replaces last command rather than adding to it,
Bug Maybefound <=
- Re: history -s from inside function replaces last command rather than adding to it, Chet Ramey, 2024/12/14
- Re: history -s from inside function replaces last command rather than adding to it, Dale R. Worley, 2024/12/16
- Re: history -s from inside function replaces last command rather than adding to it, Chet Ramey, 2024/12/16
- Re: history -s from inside function replaces last command rather than adding to it, Greg Wooledge, 2024/12/16
- Re[2]: history -s from inside function replaces last command rather than adding to it, Bug Maybefound, 2024/12/17
- Re: history -s from inside function replaces last command rather than adding to it, Chet Ramey, 2024/12/17
- Re[2]: history -s from inside function replaces last command rather than adding to it, Bug Maybefound, 2024/12/17
- Re: history -s from inside function replaces last command rather than adding to it, Greg Wooledge, 2024/12/17
- Re: history -s from inside function replaces last command rather than adding to it, Chet Ramey, 2024/12/17
- Re: history -s from inside function replaces last command rather than adding to it, Dale R. Worley, 2024/12/17