diff options
author | LAN-TW <lantw44@gmail.com> | 2011-12-29 22:50:15 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2011-12-29 22:50:15 +0800 |
commit | f34d6bf31b8786874a647c8a483cc8751466efc5 (patch) | |
tree | 820754370a8beebab8bc774d02a59f658254edac | |
parent | 1d983dd5d9f3abb7a0fdaa6c6cbe9238c0f92b90 (diff) | |
download | configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar.gz configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar.bz2 configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar.lz configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar.xz configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.tar.zst configfile-f34d6bf31b8786874a647c8a483cc8751466efc5.zip |
bash_include: 顯示歷史紀錄新增的行數bash_include-20111229
-rw-r--r-- | bash_include | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bash_include b/bash_include index 8e7e10d..5647ac4 100644 --- a/bash_include +++ b/bash_include @@ -11,7 +11,7 @@ if tty -s; then interactive_shell=1; fi # Internal Variables -default_tty_setting=`stty -g` +[ "$interactive_shell" ] && default_tty_setting=`stty -g` colorprompting='\[\e[1;31m\]\!\[\e[m\] [\[\e[1;33m\]\u\[\e[m\]@\[\e[1;32m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]]\$ ' nocolorprompting='\! [\u@\h \w]\$ ' @@ -307,7 +307,13 @@ function prehistory_backup () echo " 4. Run the command \`prehistory_backup' again." return 3 fi - echo "Backing up current history file ($previoushistorycount -> $currentcount)" + echo -n "Backing up current history file ($previoushistorycount -> $currentcount, " + if [ "$previoushistorycount" = "$currentcount" ] + then + echo "no modification)" + else + echo "+$(($currentcount-$previoushistorycount)))" + fi echo "$currentcount" > "$historycountfile" \cp -f "$HISTFILE" "$historybackupfile" } |