Below is the code to remake the rm command. I remade it so I could send everything i delete to a trashbin. It sends it to your home/.Trashbin. If the directory isnt there, it makes it for you. After that it tests to see if there are any arguments after the command, and if there are 0 it sends back a message. If there are arguments it continues. If the second argument is the -r flag then it send everything after the flag to the trashbin, no matter what. If there isnt the -r present then it only sends files to the trashbin, and if it finds out you tried to delete a directory, it sends back an error. This was made in a bourne-again shell.
Thanks!
Checkout the code below. Read the rest of this entry »
