pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Wed 3rd Jun 2015 04:14
raw | new post

  1. function extract ()  
  2. {
  3.     if [ -f $1 ] ; then
  4.       case $1 in
  5.         *.tar.bz2)   tar xjf "$1"     ;;  
  6.         *.tar.gz)    tar xzf "$1"     ;;  
  7.         *.bz2)       bunzip2 "$1"     ;;  
  8.         *.rar)       unrar e "$1"     ;;  
  9.         *.gz)        gunzip "$1"      ;;  
  10.         *.tar)       tar xf "$1"      ;;  
  11.         *.tbz2)      tar xjf "$1"     ;;  
  12.         *.tgz)       tar xzf "$1"     ;;  
  13.         *.zip)       unzip "$1"       ;;  
  14.         *.Z)         uncompress "$1"  ;;  
  15.         *.7z)        7z x "$1"        ;;  
  16.         *)     echo "'$1' cannot be extracted via extract()" ;;
  17.          esac
  18.      else
  19.          echo "'$1' is not a valid file"
  20.      fi  
  21. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at