18 lines
475 B
Bash
Executable File
18 lines
475 B
Bash
Executable File
#!/bin/sh
|
|
|
|
for file in "$@"; do
|
|
case "$file" in
|
|
*.tar) tar xvf "$file" ;;
|
|
*.tar.gz|*.tgz) tar xzvf "$file" ;;
|
|
*.tar.bz2|*.tbz2) tar xjvf "$file" ;;
|
|
*.tar.xz|*.txz) tar xJvf "$file" ;;
|
|
*.zip) unzip "$file" ;;
|
|
*.rar) unrar x "$file" ;;
|
|
*.7z) 7z x "$file" ;;
|
|
*.gz) gunzip "$file" ;;
|
|
*.bz2) bunzip2 "$file" ;;
|
|
*.xz) unxz "$file" ;;
|
|
*) echo "Unknown archive type: $file" ;;
|
|
esac
|
|
done
|