Alias for extracting archives.
This commit is contained in:
parent
9baf769a41
commit
da7a90c337
@ -34,3 +34,26 @@ function codepoint() {
|
|||||||
perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))"
|
perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))"
|
||||||
echo # newline
|
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
|
# Install everything else
|
||||||
brew install git
|
brew install git
|
||||||
brew install git-extras
|
brew install git-extras
|
||||||
|
brew install unrar
|
||||||
#brew install node
|
#brew install node
|
||||||
|
|
||||||
# Remove outdated versions from the cellar
|
# Remove outdated versions from the cellar
|
||||||
|
Loading…
Reference in New Issue
Block a user