kaelzhang / shell-safe-rm

😎 Safe-rm: A drop-in and much safer replacement of bash rm with nearly full functionalities and options of the rm command! Safe-rm will act exactly the same as the original rm command.
Other
428 stars 33 forks source link

fixes issue #31 and #27: safe-rm prompts message when file contains whitespaces #33

Open Dylan-B-Johnson opened 3 months ago

Dylan-B-Johnson commented 3 months ago

Fixes #31 and Fixes #27

Previously using safe-rm on a filename with multiple spaces in it would succeed, but produce an error message. Now it does not produce that error message. e.g. echo "s" > tmp\ tmp\ tmp.txt; ./rm.sh tmp\ tmp\ tmp.txt Produced:

basename: extra operand ‘tmp.txt’
Try 'basename --help' for more information.
basename: extra operand ‘tmp.txt’
Try 'basename --help' for more information.

This occurs because the filename is passed into rm.sh as a single string with spaces, but back-slashes/quotes were not used when passing the filename into the basename command within the script. I added the necessary quotes.

tapyu commented 2 weeks ago

It is a shame that this repo is abandoned. I wonder what are our way out to maintain this repo. Can we flag this repo as abandoned to GitHub so that we can keep maintaing it in your fork? Good PR, btw.