diff --git a/.bashrc b/.bashrc index 37ee32a..0b76390 100644 --- a/.bashrc +++ b/.bashrc @@ -1,5 +1,18 @@ # Bourne Again SHell init file. # +function logcat +{ +ext=`date +%m-%Y` +if [ ! -d $HOME/history ] ; then + mkdir -p $HOME/history +fi +index=$1 +dt=$2 +tm=$2 +shift 3 +echo "$dt $tm [$PWD] [$index]: $*" >> $HOME/history/.history.$ext +} + if [ -f /etc/bashrc ]; then . /etc/bashrc fi @@ -9,7 +22,7 @@ fi # If running interactively, then: if [ "$PS1" ]; then set noclobber - declare -x PROMPT_COMMAND='PS1=`pwd`\>' + declare -x PROMPT_COMMAND='PS1="$HOSTNAME:($USER) $PWD >"; logcat $(history 1)' # # Set readonly variables # @@ -32,8 +45,13 @@ if [ "$PS1" ]; then # Make it so that failed `exec' commands don't flush this shell. no_exit_on_failed_exec=1 - HISTFILE=$HOME/.history - HISTFILESIZE=-1 + if [ ! -d $HOME/history ] ; then + mkdir -p $HOME/history + fi + HISTFILE=$HOME/history/.history + HISTSIZE=300 + HISTTIMEFORMAT="%F %T " + HISTCONTROL="ignorespace:ignoredups" MAIL=$HOME/Maildir MAILCHECK=60 diff --git a/.glogout b/.glogout index 40af53f..6831e79 100644 --- a/.glogout +++ b/.glogout @@ -1,3 +1,3 @@ -#!/bin/gsh -# @(#)Logout 1.3 010294 Manvendra +#!/bin/bash +# @(#)Logout 1.3 01-02-1994 Manvendra echo "`hostname`: $LOGNAME logged out at `date`"