pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.99k stars 79 forks source link

Fast Path impl does not escape special chars like `$` #220

Closed boozook closed 1 year ago

boozook commented 1 year ago

OS: macOS Shell: ZSH (default)

I have $ in filenames in some local wiki. Seems to it's "tiddlywiki".

fclones produces commands like this:

rm '/Users/ak/Documents/GD Wiki/Notes/tiddlers/$__plugins_tiddlywiki_help_HelpPanel_Videos.md'

But instead must be:

rm "/Users/ak/Documents/GD Wiki/Notes/tiddlers/\$__plugins_tiddlywiki_help_HelpPanel_Videos.md"
  1. with escaped $
  2. with normal quotes " because single quotes ' is for eval.
pkolaczk commented 1 year ago

Just tried it on macOS and zsh quoting works the same way how fclones assumes it to work:

piotr@mbp fclones (update-deps) % zsh
piotr@mbp fclones (update-deps) % echo '$foo'
$foo
piotr@mbp fclones (update-deps) % echo "$foo"

piotr@mbp fclones (update-deps) % 

Single quotes are for literal quoting (no eval), doule quotes do eval.