UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 3161 - October 2, 2009
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SEPARATE SHELL COMMAND HISTORY FILES
In any X based desktop when the number of pseudo terminal windows are more then one, the common shell history file (KSH) becomes a nuisance. Here is a way to have separate, safe and limited shell command history files.
Put the following code in your shell RC file.
--------------------------------CODE START------------------------------------
# Form a unique name for the shell history file using the tty output and
# set the shell variable HISTFILE to point to that
# This solves the problem of mutiple shells using the same history file
# and causing the confusion....
histf=`tty | awk 'BEGIN {FS="/"; nm=".shist_"} { for (i=1; i<=NF; i++) nm = nm
$i;} END { print nm;} '`
export HISTFILE=$histf
\rm -f $histf
echo History file is $histf...
--------------------------------CODE END------------------------------------
This tip generously supported by: atulk@informix.com
--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today
==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.
Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
Tidak ada komentar:
Posting Komentar