LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-13-2012, 04:06 AM   #1
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
No bash_history after bashrc setup in LFS


I finished installing LFS & started BLFS after moving on to Bash Shell Startup Files I have no bash history on reboot.
Bash history allows me to remember what I did last, how do I get it back?

I looked at /etc/profile script & noticed a line that may have affected bash_history, can someone correct me if I'm wrong?

Code:
# Set the initial path export PATH=/bin:/usr/bin  if [ $EUID -eq 0 ] ; then         pathappend /sbin:/usr/sbin         unset HISTFILE fi
Is it s simple as changing unset to set?
 
Old 11-13-2012, 04:14 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
This part:
Code:
if [ $EUID -eq 0 ] ; then
        pathappend /sbin:/usr/sbin
        unset HISTFILE
fi
is only done when the user is root, normal users shouldn't be influenced by it.

Remove the bold part if you want root to have a history file.

PS: This from the bash man page:
Quote:
HISTFILE
The name of the file in which command history is saved (see HIS‐
TORY below). The default value is ~/.bash_history. If unset,
the command history is not saved when an interactive shell
exits.
 
1 members found this post helpful.
Old 11-13-2012, 04:35 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Thank you I changed to set & it brought back history but still wasn't saving unless in chroot environment, not in console
 
Old 11-13-2012, 04:46 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by EDDY1 View Post
Thank you I changed to set & it brought back history but still wasn't saving unless in chroot environment, not in console
Once you finish LFS you shouldn't be using the chrooted environment. Boot into you finished LFS and work from there.

Assuming all the bash startup files are in place and do not have any typo's: You do realize that the history is written to file when you end your session (ctrl-d/exit)?

BTW: I would remove the unset line (as mentioned before) and not change it to set HISTFILE.

Last edited by druuna; 11-13-2012 at 05:02 AM. Reason: typo: an -> and
 
1 members found this post helpful.
Old 11-13-2012, 05:08 AM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Yes I understand that I'm not supposed to be in chroot environment, but it was necessary to get my network operational, now that network, gpm & links is working I can proceed with getting everything else running.
 
Old 11-13-2012, 05:19 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Yes Ctrl-d does work thank you
 
  


Reply

Tags
bashrc, histfile, history, lfs



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to use my /home/kangjoo/.bashrc rather than root/.bashrc kangjoo.lee Linux - Newbie 2 11-05-2012 03:38 PM
Setting path: /etc/profile, /etc/bashrc or ~/.bashrc Swakoo Linux - General 1 08-07-2007 10:59 PM
LFS 6.2: made mistake when going from lfs to root setup oldgeek Linux From Scratch 4 11-12-2006 09:00 PM
LFS livecd 6.1.1-3 eth0 setup (static ipv4) gregben Linux From Scratch 1 02-14-2006 07:20 AM
how to setup dhcp in lfs? lmmix Linux From Scratch 3 02-21-2005 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration