Last active
August 29, 2015 14:07
-
-
Save jeremywrnr/5ba6015a2012ec3ee661 to your computer and use it in GitHub Desktop.
convenient (and more visually appealing) alternative to [ rm -rf (dirname); rmdir (dirname) ]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
for arg; do | |
# ptint out folder structure to remove | |
printf "\n Folder to remove: $arg\n\n" | |
tree "$arg" | |
printf "\n[y/n] Remove folder? " | |
read CONTINUE | |
# parse input and delete folder | |
if [ "$CONTINUE" = "y" ]; then | |
printf "\nRemoving $arg now...\n\n" | |
rm -vrf "$arg" | |
# rmdir -p "$arg" | |
printf "\nOperations completed.\n\n" | |
else | |
printf "\nFolder $arg not deleted.\n\n" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment