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

Error in filenames with more than 2 spaces (1.0.7) #27

Open pveierland opened 2 years ago

pveierland commented 2 years ago

Thank you for a great program!

I've been using it for a while, however I got an error today for a filename with more than two spaces:

touch "a b c"
./rm.sh "a b c"
basename: extra operand β€˜c’
Try 'basename --help' for more information.
basename: extra operand β€˜c’
Try 'basename --help' for more information.

The program appears to do the right thing, as the file is removed and seemingly correctly placed in the trash.

Note that there is no error for a filename with 1 space:

touch "a b"
./rm.sh "a b"

System configuration:

alias rm='/nix/store/16m5g0j6rc9fx3rxhxbwzs4sy07abyd5-shell-safe-rm-1.0.7/bin/rm.sh'
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)
Linux xxx 5.10.101 #1-NixOS SMP Wed Feb 16 11:54:31 UTC 2022 x86_64 GNU/Linux
rial1106 commented 2 years ago

I am having the same problem.

[snowman@asus ~/Downloads] rm -rf All\ About\ The\ Benjamins\ \(2002\)
basename: extra operand β€˜The’
Try 'basename --help' for more information.
basename: extra operand β€˜The’
Try 'basename --help' for more information.

System Details

Linux asus 5.18.0-artix1-1 #1 SMP PREEMPT_DYNAMIC Thu, 26 May 2022 13:26:58 +0000 x86_64 GNU/Linux

My basename version is

basename (GNU coreutils) 9.1

Command executed on Tue May 31 07:35:24 PM SAST 2022