aboutsummaryrefslogtreecommitdiffstats
path: root/bash_include
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2011-12-01 22:38:21 +0800
committerLAN-TW <lantw44@gmail.com>2011-12-01 22:38:21 +0800
commit4ebad5c530cff0570146d9ca8f3a72957f907761 (patch)
tree55fcad3d6ade957535ad6e67366254177695b40e /bash_include
parentcaa540da93885c83ef01b656aeb37ebd18f2e2c8 (diff)
downloadconfigfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar.gz
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar.bz2
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar.lz
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar.xz
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.tar.zst
configfile-4ebad5c530cff0570146d9ca8f3a72957f907761.zip
bash_include: 防止背景執行輸出目錄名稱衝突、移除輸出檔功能bash_include-20111201
Diffstat (limited to 'bash_include')
-rw-r--r--bash_include52
1 files changed, 49 insertions, 3 deletions
diff --git a/bash_include b/bash_include
index 639124f..5099882 100644
--- a/bash_include
+++ b/bash_include
@@ -14,7 +14,7 @@ nocolorprompting='\! [\u@\h \w]\$ '
historycountfile="$HOME/.bash_history.count"
historybackupfile="$HOME/.bash_history.bak"
-bgrunfiledir="$HOME/tmp/bgrun"
+bgrunfiledir="$HOME/tmp/bgrun-`whoami`"
HISTSIZE=1000000
HISTFILESIZE=1000000
@@ -139,6 +139,7 @@ alias bgv=bgview
alias bgl=bglist
alias bgc=bgcount
alias bgls=bglist
+alias bgrm=bgclean
function bgrun ()
{
@@ -199,6 +200,23 @@ function bgcount ()
find "$bgrunfiledir" -maxdepth 1 -mindepth 1 | cut -d - -f 2,3 | wc | awk '{print $2}'
}
+function bgclean ()
+{
+ while [ "$1" ]
+ do
+ if [ "$1" = "all" ]
+ then
+ echo "Removing the directory $bgrunfiledir"
+ rm -rf "$bgrunfiledir" &
+ return 0
+ fi
+ filename=`find "$bgrunfiledir" -maxdepth 1 -mindepth 1 | sort | sed -n $1p`
+ echo "Removing $filename"
+ rm -f $filename
+ shift
+ done
+}
+
########## Background End ##########
function check_dmesg ()
@@ -236,13 +254,41 @@ function prehistory_backup ()
return 1
fi
echo "$currentcount" > "$historycountfile"
- cp -f "$HISTFILE" "$historybackupfile"
+ \cp -f "$HISTFILE" "$historybackupfile"
+}
+
+########## Trash Manager ##########
+
+function trash_mv ()
+{
+ echo aa
+}
+
+function trash_rm ()
+{
+ echo bb
+}
+
+function trash_ls ()
+{
+ echo cc
+}
+
+function trash_view ()
+{
+ echo dd
+}
+
+function trash_du ()
+{
+ echo ee
}
+########## Trash Manager End ##########
-# Starting doing something
+# Doing something
startcolor
prehistory_backup