From owner-freebsd-ports@FreeBSD.ORG Sat Sep 20 21:42:15 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01DED1065670 for ; Sat, 20 Sep 2008 21:42:15 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA04.emeryville.ca.mail.comcast.net (qmta04.emeryville.ca.mail.comcast.net [76.96.30.40]) by mx1.freebsd.org (Postfix) with ESMTP id DAC7B8FC1A for ; Sat, 20 Sep 2008 21:42:13 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by QMTA04.emeryville.ca.mail.comcast.net with comcast id H8Zq1a0070x6nqcA49iDiK; Sat, 20 Sep 2008 21:42:13 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA12.emeryville.ca.mail.comcast.net with comcast id H9iC1a0034v8bD78Y9iDDj; Sat, 20 Sep 2008 21:42:13 +0000 X-Authority-Analysis: v=1.0 c=1 a=JdViZEfnDJgA:10 a=2X2Dv3S5izkA:10 a=QycZ5dHgAAAA:8 a=m02veY6Q04nGri__SqwA:9 a=03B6K3lWbEtt6qluzEEA:7 a=kheiMneUdz42xFvmghrJWK8257kA:4 a=EoioJ0NPDVgA:10 a=SV7veod9ZcQA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 6A8D217B81A; Sat, 20 Sep 2008 14:42:12 -0700 (PDT) Date: Sat, 20 Sep 2008 14:42:12 -0700 From: Jeremy Chadwick To: manish jain Message-ID: <20080920214212.GA82955@icarus.home.lan> References: <71a1c60e0809201048s168fe713j3ec661eeb93f4492@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71a1c60e0809201048s168fe713j3ec661eeb93f4492@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-ports@freebsd.org Subject: Re: Incorrect commandline history with bash X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 21:42:15 -0000 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@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 |