Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ORION.MC.DUKE.EDU!bet From: bet@ORION.MC.DUKE.EDU (Bennett Todd) Newsgroups: gnu.bash.bug Subject: History, actually not a bug, but a documentation suggestion Message-ID: <8907262102.AA15543@orion> Date: 26 Jul 89 21:02:12 GMT Sender: bob@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 59 I started off with the following bug complaint: |I include the history number in my prompt so that, if a command is still |on the screen, I can refer to it via | | !number | |Bash 1.01 didn't handle that. In particular, using 55-line-long MGR |windows (my normal window size -- boy are they addictive!) I looked |halfway up the screen and saw that the command I wanted to re-execute |was number 19, and here's what happened: | | bent[29] !19 | 19: Event not found. | |Drat. | |Hey, waitaminit, I just typed "history", and (a loooong time later, |after much scrolling) I found that command at *519*!!! And, sure enough, |"!519" worked! Either the reference (in features) to: | | \# the command number of this command | |(in the section on "the comment next to the decode_prompt_string |function") or the reference: | | `!n' | Refer to command line N. | |(in "Event Designators" in "History Expansion") has a problem. Frankly, |I wish that they both were true. However, it looks like they are at odds |with attempting to have the command history persist via the external |file, in the face of multiple bashes on multiple windows. | |Waitaminitagain! |Hmmm... ... and I figured it all out! Brian, terrific job! Some folks *like* C-shells property of lacking externally recorded history, having totally separate and unrelated histories for each invocation of a shell. I confess to being one of these poor old inflexible lusers. You might mention in the docs that such folks can keep their defective preferences if they (1) Create a directory "~/.bash-histories" (for example) (2) Add to .bashrc the incantation: HISTFILE=~/.bash-histories/$$ (making sure of course that .bashrc is sourced from .profile). (3) Add to .bash_logout the following: rm ~/.bash-histories/* Far out! Now *everybody* can be happy! Thanks again for the great shell! -Bennett bet@orion.mc.duke.edu