Guest User

Untitled

a guest
May 7th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  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" "${@##*/}"
Advertisement
Add Comment
Please, Sign In to add comment