Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Uncompress any archive
- for compressed_file in "$@"; do
- if [[ "${compressed_file}" == *.tar.??? ]] \
- || [[ "${compressed_file}" == *.tar.?? ]]
- then EXTRACTION_DIR="${compressed_file%.*.*}"
- else EXTRACTION_DIR="${compressed_file%.*}"
- fi
- mkdir "$EXTRACTION_DIR"
- bsdtar --extract --cd "$EXTRACTION_DIR" --file="$compressed_file"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement