pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.82k stars 70 forks source link

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

Closed boozook closed 8 months ago

boozook commented 11 months 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 8 months 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.