|
|
发表于 2009-6-28 20:25:22
|
显示全部楼层
Post by aegean sea;2001757

忍不住说一声,这部分的配置改了,现在这种方式更好一些
详见 http://wiki.linuxtoy.org/index.p ... E%E6%96%87%E4%BB%B6
[php]
#每个目录使用独立的历史纪录{{{
HISTDIR="$HOME/.zhistory"
[[ ! -d "$HISTDIR" ]] && mkdir -p "$HISTDIR"
HISTFILE="$HISTDIR/${PWD//\//:}"
chpwd() {
# fc -W # write current history file
# "setopt INC_APPEND_HISTORY"
HISTFILE="$HISTDIR/${PWD//\//:}" # set new history file
[[ ! -e "$HISTFILE" ]] && touch $HISTFILE
local ohistsize=$HISTSIZE
HISTSIZE=0 # Discard previous dir's history
HISTSIZE=$ohistsize # Prepare for new dir's history
fc -R # read from current histfile
}
function allhistory { cat $HISTDIR/* } #*/
function convhistory {
sort $1 | sed 's/^:\([ 0-9]*\):[0-9]*;\(.*\)/\1::::::\2/' |
awk -F"::::::" '{ $1=strftime("%Y-%m-%d %T",$1) "|"; print }'
}
[/php] |
|