Re: bash History on F7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adel ESSAFI wrote:
Dear All
I have a strange behaviour on my bash shell on F7. In some session, I lose all the histoty!!! I don t find any command that I have executed in my previous sessions.
Regards.
Adel

From my custom /etc/profile:

# reconfigure the history file
#       prevents multiple logins to the same id from clashing
#       thought to work for bash and ksh
#================================================================
if [ -n "$HISTFILE" ]; then
  hdir=${HISTFILE%/*}
  hfile=${HISTFILE##*/}
  nfile=$(tty); nfile=.sh_hist_${nfile##*/}
  if [ "$hfile" != "$nfile" ]; then
    ( cd $hdir && touch $hfile && mv $hfile $nfile ) &&
      HISTFILE=${hdir}/${nfile}
  fi
  unset hdir hfile nfile
fi

Note, this was written in 1990 or so, when ksh was a very new toy. It has been working untouched for about 15 years, and the only thing changed is that on exit I now shred, purge, or at least delete the file for security. The world is a scarier place now. :-(

--
Bill Davidsen <davidsen@xxxxxxx>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux