This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: close cygwin window - bash doesnt save history


----- Original Message -----
From: Dario Alcocer <alcocer@helixdigital.com>
> On Thu, Jul 11, 2002 at 01:26:01AM -0500, Shane Brooks wrote:
[snip]
> >  sounds great but perhaps I dont understand the answer - I'm not a programmer or unix boy.  I tried typing the following in a bash session but it didnt execute the exit statement when I closed the window.
> > 
> > $ myclosefn() {
> > > exit
> > > }
> > 
> > $ trap myclosefn SIGHUP
> 
> Well, exit by itself won't do what you want.  If you read the bash
> manpage, you'll see that there are several environment variables
> that control history.  I invite you to read HISTORY (not yelling,
> manpage section names are in caps) in the bash manpage.  I *assure*
> you, your question *will* be answered by a careful reading.
> 
> I like to think that one of the preconditions of using Unix-like
> tools like Cygwin is the user must be prepared to read manpages and
> examples to accomplish the task at hand and expand their mastery
> of the environment.

I couln't agree with you more.  I have read the bash man pages several times over though I dont understand it all. I have also checked the environment variables that control history several times over.  My cygwin install is bog standard as far as BASH is concerned. History works as expected under all conditions other than trying to follow your advice above.  "exit" *does* do exactly what I want if I type it at the bash command prompt (ie it saves the history, logs out of the bash session and the WindowsXP command window closes.  I assumed that calling "exit" from the trap command may also lead the the history being saved.

Believe me - we aren't all newbies looking for a quick lazy fix - but at some stage we *are* all newbies.

I dont have the TTY env var set...but thats another thread. 

Still tryin'

Shane
-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]