LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   No bash_history after bashrc setup in LFS (http://www.linuxquestions.org/questions/linux-from-scratch-13/no-bash_history-after-bashrc-setup-in-lfs-4175436904/)

EDDY1 11-13-2012 05:06 AM

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?

druuna 11-13-2012 05:14 AM

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.


EDDY1 11-13-2012 05:35 AM

Thank you I changed to set & it brought back history but still wasn't saving unless in chroot environment, not in console

druuna 11-13-2012 05:46 AM

Quote:

Originally Posted by EDDY1 (Post 4828225)
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.

EDDY1 11-13-2012 06:08 AM

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.

EDDY1 11-13-2012 06:19 AM

Yes Ctrl-d does work thank you


All times are GMT -5. The time now is 01:41 PM.