Alias for extracting archives.
This commit is contained in:
		| @@ -33,4 +33,27 @@ function unidecode() { | ||||
| function codepoint() { | ||||
| 	perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))" | ||||
| 	echo # newline | ||||
| } | ||||
| } | ||||
|  | ||||
| # Extract archives of various types | ||||
| function extract() { | ||||
| 	if [ -f $1 ] ; then | ||||
| 		local dir_name=${1%.*}  # Filename without extension | ||||
| 		case $1 in | ||||
| 			*.tar.bz2)  tar xjf           $1 ;; | ||||
| 			*.tar.gz)   tar xzf           $1 ;; | ||||
| 			*.tar.xz)   tar Jxvf          $1 ;; | ||||
| 			*.tar)      tar xf            $1 ;; | ||||
| 			*.tbz2)     tar xjf           $1 ;; | ||||
| 			*.tgz)      tar xzf           $1 ;; | ||||
| 			*.bz2)      bunzip2           $1 ;; | ||||
| 			*.rar)      unrar x           $1 ;; | ||||
| 			*.gz)       gunzip            $1 ;; | ||||
| 			*.zip)      unzip -d$dir_name $1 ;; | ||||
| 			*.Z)        uncompress        $1 ;; | ||||
| 			*)          echo "'$1' cannot be extracted via extract()" ;; | ||||
| 		esac | ||||
| 	else | ||||
| 		echo "'$1' is not a valid file" | ||||
| 	fi | ||||
| } | ||||
|   | ||||
| @@ -24,6 +24,7 @@ brew install homebrew/dupes/grep | ||||
| # Install everything else | ||||
| brew install git | ||||
| brew install git-extras | ||||
| brew install unrar | ||||
| #brew install node | ||||
|  | ||||
| # Remove outdated versions from the cellar | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Artem Sapegin
					Artem Sapegin