Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Tarfile="$1.tar.bz"
  2. count=1
  3. cd "${@%/*}"
  4. if [ $# -eq 1 ]; then
  5.   while [ -e "$Tarfile" ]
  6.   do
  7.     let count++
  8.     Tarfile="$1 $count.tar.bz"
  9.   done
  10. else
  11.   Tarfile="Archive.tar.bz"
  12.   while [ -e "$Tarfile" ]
  13.   do
  14.     let count++
  15.     Tarfile="Archive $count.tar.bz"
  16.   done
  17. fi
  18. /usr/bin/tar -jchf "$Tarfile" "${@##*/}"