Skip to content

Commit

Permalink
updated .bashrc, .glogout
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Jun 23, 2020
1 parent b0990f2 commit ffa63ee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
24 changes: 21 additions & 3 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
#
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .glogout
Original file line number Diff line number Diff line change
@@ -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`"

0 comments on commit ffa63ee

Please sign in to comment.