My dotfiles for my Linux rice managed with stow and make
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

extract 585B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. if [ -f $1 ] ; then
  3. case $1 in
  4. *.tar.bz2) tar xvjf ../$1 ;;
  5. *.tar.gz) tar xvzf ../$1 ;;
  6. *.tar.xz) tar xvJf ../$1 ;;
  7. *.lzma) unlzma ../$1 ;;
  8. *.bz2) bunzip2 ../$1 ;;
  9. *.rar) unrar x -ad ../$1 ;;
  10. *.gz) gunzip ../$1 ;;
  11. *.tar) tar xvf ../$1 ;;
  12. *.tbz2) tar xvjf ../$1 ;;
  13. *.tgz) tar xvzf ../$1 ;;
  14. *.zip) unzip ../$1 ;;
  15. *.Z) uncompress ../$1 ;;
  16. *.7z) 7z x ../$1 ;;
  17. *.xz) unxz ../$1 ;;
  18. *.exe) cabextract ../$1 ;;
  19. *) echo "extract: '$1' - unknown archive method" ;;
  20. esac
  21. else
  22. echo "$1 - file does not exist"
  23. fi