From: Francois Fleuret Date: Tue, 14 Jun 2011 06:51:45 +0000 (+0200) Subject: Added the ua (unarchive) shortcut + an option in selector-history. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=commitdiff_plain;h=e035956d6edd0e601b7d1b50a4ed2e7b3ce81b00 Added the ua (unarchive) shortcut + an option in selector-history. --- 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