shell-safe-rm icon indicating copy to clipboard operation
shell-safe-rm copied to clipboard

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

Open Dylan-B-Johnson opened this issue 7 months ago • 1 comments

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.

Dylan-B-Johnson avatar Jul 17 '24 04:07 Dylan-B-Johnson