Fwd: Re: Incorrect commandline history with bash

Jeremy Chadwick koitsu at FreeBSD.org
Sun Sep 21 21:52:56 UTC 2008


Individual did not CC the mailing list on his response.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |

----- Forwarded message from manish jain <unxfbsdi at gmail.com> -----

> From: manish jain <unxfbsdi at gmail.com>
> To: Jeremy Chadwick <koitsu at freebsd.org>
> Date: Mon, 22 Sep 2008 01:54:46 +0530
> Subject: Re: Incorrect commandline history with bash
> 
> Thanks Jeremy. Sourcing .bash_profile from .bashrc solved the problem. For
> some reason, sourcing .bashrc from .bash_profile worked equally well with
> the version of Linux I was previously using.
> 
> Regards
> Manish Jain
> 
> 
> 
> On 9/21/08, Jeremy Chadwick <koitsu at freebsd.org> wrote:
> >
> > On Sat, Sep 20, 2008 at 11:18:34PM +0530, manish jain wrote:
> > > I just migrated from Linux and I am now using FreeBSD 6.3. My keyboard
> > > layout is US-ISO and my TERM is con25. I am using bash#3 as my login
> > shell.
> > > (I installed the bash package from the distribution media, not from
> > > /usr/ports).
> > >
> > > The problem is that bash does not remember my commands correctly. Almost
> > all
> > > commands I enter in a login session are forgotten in the next session.
> > Using
> > > the Up and Down arrow keys navigates a mangled and incomlete command
> > > history. Even using Ctrl-r for a reverse find almost never fetches a
> > command
> > > I had actually typed in previously.
> > >
> > > The following are the contents of my .bash_profile and .bashrc:
> > >
> > > #.bash_profile :
> > > [ -f ~/.bashrc ] && source ~/.bashrc
> > > #end-of-file
> >
> > You have this backwards.  ~/.bashrc should contain something like this:
> >
> > if [ -f "${HOME}/.bash_profile" ]
> > then
> > source "${HOME}/.bash_profile"
> > fi
> >
> > And all of your applicable environment settings should go in
> > .bash_profile.  This probably won't solve your problem, but I thought
> > I'd point it out.
> >
> > > #.bashrc :
> > > export HISTFILESIZE=200
> > > shopt -s cmdhist
> > > shopt -s histappend
> > > #end-of-file
> >
> > I set none of these things (though I do use export HISTTIMEFORMAT="%T  "
> > but that should not affect your problem) and my .bash_history always
> > contains commands from past sessions, including timestamps too.
> >
> > My options are defaults:
> >
> > $ shopt | egrep 'cmdhist|histappend'
> > cmdhist         on
> > histappend      off
> >
> > Can you please try pkg_delete'ing the bash you installed from the
> > installation media, and instead update your ports tree via csup (not
> > cvsup) and then build/install bash from /usr/ports/shells/bash?
> >
> > Finally, please do not cross-post to multiple lists.  It's shunned upon,
> > and generally pointless as not everyone is subscribed to both lists.
> > I've removed freebsd-questions at freebsd.org, as this could be a ports
> > issue rather than a generic question.
> >
> > --
> > | Jeremy Chadwick                                jdc at parodius.com |
> > | Parodius Networking                       http://www.parodius.com/ |
> > | UNIX Systems Administrator                  Mountain View, CA, USA |
> > | Making life hard for others since 1977.              PGP: 4BD6C0CB |
> >
> >

----- End forwarded message -----


More information about the freebsd-ports mailing list