Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/home/lester/base/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux vmw-les.eng.vmware.com 2.6.40.6-0.fc15.x86_64 #1 SMP Tue Oct 4 00:39:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.2 Patch Level: 10 Release Status: release Description: The "history -s" usually removes the last history item which is usually the "history -s" command itself, but PROMPT_COMMAND disables history and causes an unrelated command to be deleted. Repeat-By: $ history -s '# line 1' ; history -s '# line 2' ; history 2 X1 # line 1 X2 # line 2 $ PROMPT_COMMAND="history -s '# line 3' ; history -s '# line 4'" $ history 5 X1 # old command X2 # line 1 X3 # line 2 X4 # line 3 X5 # line 4 Expect: X1 # line 1 X2 # line 2 X3 PROMPT_COMMAND="history -s '# line 3' ; history -s '# line 4'" X4 # line 3 X5 # line 4 No new commands will enter history as they are replaced with $'# line 3\n# line 4' Fix: Either add a switch to disable the deletion, or stop the auto-delete when history is disabeled in: parse.y 2466: parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);