Last active
December 30, 2015 10:39
-
-
Save itsthatguy/7817428 to your computer and use it in GitHub Desktop.
Revisions
-
itsthatguy renamed this gist
Dec 6, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
itsthatguy revised this gist
Dec 6, 2013 . 2 changed files with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ # If you don't want to be prompted, use this one del() { mv -v $* $HOME/.Trash/; } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ # If all you want is to be prompted, and don't care about moving # files to the trash, you could use the following: alias rm="rm -i" -
itsthatguy revised this gist
Dec 6, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ # Or if you don't want to be prompted, use this one del() { mv -v $* $HOME/.Trash/; } -
itsthatguy revised this gist
Dec 6, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Add this to your .bash_profile, .bashrc, .zshrc or wherever you keep your bash functions and aliases. del() { RED="\e[31m" YELLOW="\e[33m" -
itsthatguy revised this gist
Dec 6, 2013 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,12 @@ del() { RED="\e[31m" YELLOW="\e[33m" WHITE="\e[97m" if [[ $# -eq 0 ]] ; then echo -e "Sorry dude, I can't do anything with that. Nothing specified." else echo -ne "${YELLOW}You're about to move the following items to the trash:${RED}\n > $*\n${YELLOW}Are you sure? [y/n] " read answer finish="-1" while [ "$finish" = '-1' ] -
itsthatguy created this gist
Dec 6, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ del() { autoload colors; colors; if [[ $# -eq 0 ]] ; then echo -e "Sorry dude, I can't do anything with that. Nothing specified." else echo -ne "$fg[yellow]You're about to move the following items to the trash:$fg[red]\n > $*\n$fg[yellow]Are you sure? [y/n] " read answer finish="-1" while [ "$finish" = '-1' ] do finish="1" if [ "$answer" = '' ]; then answer="" else case $answer in y | Y | yes | YES ) echo "$reset_color" mv -v $* $HOME/.Trash/; answer="y"; ;; n | N | no | NO ) answer="n";; *) finish="-1"; echo -n '\nInvalid response -- please reenter:'; read answer;; esac fi done fi }