mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
bin: reformat scripts
This commit is contained in:
parent
189069980e
commit
c6b3d720d3
3 changed files with 23 additions and 16 deletions
31
bin/ex
31
bin/ex
|
|
@ -1,23 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ex () {
|
||||
ex() {
|
||||
file=$1
|
||||
[ -z "$file" ] && echo 'ex <compressed>' && return 1
|
||||
[ ! -f "$file" ] && echo 'Invalid file: `'"$file"'`' && return 1
|
||||
case "$file" in
|
||||
*.tar.bz2) tar xjf "$file";;
|
||||
*.tar.gz) tar xzf "$file";;
|
||||
*.bz2) bunzip2 "$file";;
|
||||
*.rar) unrar x "$file";;
|
||||
*.gz) gunzip "$file";;
|
||||
*.tar) tar xf "$file";;
|
||||
*.tbz2) tar xjf "$file";;
|
||||
*.tgz) tar xzf "$file";;
|
||||
*.zip) unzip "$file";;
|
||||
*.Z) uncompress "$file";;
|
||||
*.7z) 7z x "$file";;
|
||||
*.xz) unxz "$file";;
|
||||
*) echo 'Unknown suffix on file: `'"$file"'`'; return 1 ;;
|
||||
*.tar.bz2) tar xjf "$file" ;;
|
||||
*.tar.gz) tar xzf "$file" ;;
|
||||
*.bz2) bunzip2 "$file" ;;
|
||||
*.rar) unrar x "$file" ;;
|
||||
*.gz) gunzip "$file" ;;
|
||||
*.tar) tar xf "$file" ;;
|
||||
*.tbz2) tar xjf "$file" ;;
|
||||
*.tgz) tar xzf "$file" ;;
|
||||
*.zip) unzip "$file" ;;
|
||||
*.Z) uncompress "$file" ;;
|
||||
*.7z) 7z x "$file" ;;
|
||||
*.xz) unxz "$file" ;;
|
||||
*)
|
||||
echo 'Unknown suffix on file: `'"$file"'`'
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue