daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. dl=$1
  4. dirname=$(echo ${dl} | sed -e 's/\-6\.x.*tar$/\//')
  5.  
  6. cleanup() {
  7.   rm -vrf $dirname
  8. # rm -v $dl #uncomment when not debugging
  9. }
  10.  
  11. tar -xvf $dl
  12.  
  13. sedstr="'s/^'${dirname}'//'"
  14. find $dirname -type f | sed -e $sedstr
  15.  
  16. echo -en 'cleanup junk, here? [y/n] '
  17. read answ
  18. [[ $answ == 'y' || $answ == 'yes' ]] && cleanup || exit 0
RAW Paste Data
Top