Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- dl=$1
- dirname=$(echo ${dl} | sed -e 's/\-6\.x.*tar$/\//')
- cleanup() {
- rm -vrf $dirname
- # rm -v $dl #uncomment when not debugging
- }
- tar -xvf $dl
- sedstr="'s/^'${dirname}'//'"
- find $dirname -type f | sed -e $sedstr
- echo -en 'cleanup junk, here? [y/n] '
- read answ
- [[ $answ == 'y' || $answ == 'yes' ]] && cleanup || exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement