From e035956d6edd0e601b7d1b50a4ed2e7b3ce81b00 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Tue, 14 Jun 2011 08:51:45 +0200 Subject: [PATCH] Added the ua (unarchive) shortcut + an option in selector-history. --- bashrc | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 6b4d7bb..2d0f111 100644 --- 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 -- 2.20.1