From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010809 Description of problem: A construct such as this in .bash_profile should replace the last history entry so that pressing c-p at the first prompt recalls the command "blah": if true; then history -s "blah" echo status=$?; history 1 fi Under bash-2.04-21 and prior versions (back to whichever version introduced "history -s") this worked. Starting with bash-2.05-8 it does not work. Interestingly, if you change the expression so "history -s blah" is invoked on its own, it *does* work, even with bash-2.05-8: history -s "blah" echo status=$?; history 1 Note again that the problem manifests itself in the dot files. If you type these commands interactively they will always succeed. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. mkdir tmphome 2. cat >>tmphome/.bash_profile<<END if true; then history -s "blah" echo status=$?; history 1 fi END 3. HOME=$PWD/tmphome bash --login Actual Results: bash-2.05$ mkdir tmphome bash-2.05$ cat >>tmphome/.bash_profile<<END > if true; then > history -s "blah" > echo status=$?; history 1 > fi > END bash-2.05$ HOME=$PWD/tmphome bash --login status=0 bash-2.05$ Expected Results: bash-2.04$ mkdir tmphome bash-2.04$ cat >>tmphome/.bash_profile<<END > if true; then > history -s "blah" > echo status=$?; history 1 > fi > END bash-2.04$ HOME=$PWD/tmphome bash --login status=0 1 blah bash-2.04$ Additional info: works: bash-2.04$ rpm -q bash redhat-release bash-2.04-21 redhat-release-7.1-1 doesn't work: bash-2.05$ rpm -q bash redhat-release bash-2.05-8 redhat-release-7.2-1 All errata are applied on both systems.
This seems to be fixed in Red Hat Linux 8.0.