From f34d6bf31b8786874a647c8a483cc8751466efc5 Mon Sep 17 00:00:00 2001 From: LAN-TW Date: Thu, 29 Dec 2011 22:50:15 +0800 Subject: =?UTF-8?q?bash=5Finclude:=20=E9=A1=AF=E7=A4=BA=E6=AD=B7=E5=8F=B2?= =?UTF-8?q?=E7=B4=80=E9=8C=84=E6=96=B0=E5=A2=9E=E7=9A=84=E8=A1=8C=E6=95=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash_include | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bash_include') 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" } -- cgit v1.2.3