delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/06/13:32:18

Message-Id: <199807061733.MAA24721@kendall.>
Date: Mon, 6 Jul 1998 12:33:17 -0500 (CDT)
From: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
Reply-To: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
Subject: Re: Updating history file under BASH
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT delorie DOT com
MIME-Version: 1.0

-: 
-: > Since I work almost exclusively under bash, the command history doesn't
-: > get saved at all unless I remember to exit bash before shutting down.
-: > Is there a way to have my command history regularly witten to the
-: > ~/_history file from within bash?
-: 
-: According to the Bash manual (hint, hint ;-), the command "history -a" 
-: will append the current history to the history file; "history -w" will 
-: overwrite it.
-: 
-: It should be fairly simple to arrange this command to be issued during 
-: logout in your _bash_logout or some such file.

Eli,

Thank you for responding.  Yes, I am familiar with those options to the
history command, but I never really ``login'' or ``logout'' of bash
when I am using it, so it wouldn't help to issue the history command in
the bash_logout file.  I would still have to remember to issue the
command (or exit bash) before I turn off the machine.  So I think I will
need to change my bash habits and start using login/logout procedures as
you suggest.

But this raises another question: are there important reasons for
wanting to run bash as a login shell rather than an interactive shell?

I have read what the bash manual has to say about the differences
between login and interactive shells, and I have run bash both ways on
my system, but I don't see the advantages of one mode over the other (I
generally use interactive mode, but not for any compelling reason).  I
once thought/hoped that a login shell would be `permanent', i.e.,
ignore the `exit' command, but bash as login shell will `exit' to DOS
same as an interactive shell (on my machine, anyway).  I've also loaded
bash as the only shell, but then I miss the ability to run DOS batch
files, so I generally run bash on top of COMMAND.COM.

jeff williams

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019