Added the ua (unarchive) shortcut + an option in selector-history.
authorFrancois Fleuret <francois@fleuret.org>
Tue, 14 Jun 2011 06:51:45 +0000 (08:51 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Tue, 14 Jun 2011 06:51:45 +0000 (08:51 +0200)
bashrc

diff --git a/bashrc b/bashrc
index 6b4d7bb..2d0f111 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -159,6 +159,33 @@ function bak () {
     done
 }
 
+function ua () {
+    while [[ "$1" ]]; do
+
+        case "$1" in
+
+            *.tgz|*.tar.gz)
+                tar zxvf "$1"
+                ;;
+
+            *.rar)
+                unrar x "$1"
+                ;;
+
+            *.zip)
+                unzip "$1"
+                ;;
+
+            *)
+                echo "Unknown file extension $1"
+                ;;
+        esac
+
+        shift
+
+    done
+}
+
 # Create a dir and cd there
 
 function mcd () {
@@ -801,7 +828,7 @@ alias finddup='finddup -p'
 # git clone http://fleuret.org/git/selector/
 
 function selector-history () {
-    selector --bash -c 7,4,0,3 -q <(history)
+    selector --bash -u -c 7,4,0,3 -q <(history)
 }
 
 # M-r puts the selected history line in place of the current one