New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$(...) calls should be quoted: "$(...)" #1667
base: master
Are you sure you want to change the base?
Conversation
`vim $(fzf)` will not open files that have a space in the name. To fix that, use double quotes.
@@ -89,7 +89,7 @@ to install fzf. | |||
brew install fzf | |||
|
|||
# To install useful key bindings and fuzzy completion: | |||
$(brew --prefix)/opt/fzf/install | |||
"$(brew --prefix)/opt/fzf/install" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this one 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brew prefix path might include spaces, so strictly speaking it must be quoted (no one ever uses a non-default brew prefix, so yeah..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
Looks good |
I assumed that most of the users already know the implication of omitting quotes – files paths with spaces are quite rare on Unix systems, so we casually omit quotes when typing commands, and put them only when they are necessary. The commands on the README page are just simple examples (except for |
On my system they are not rare. I do not think I'm an exception. $ find ~ -name '* *' | wc -l
13637 Since omitting quotes can lead to bugs, it's always good to quote. shellcheck is a handy tool to remind of that. |
How about a happy medium, where we consistently don't use quotes, but have a note somewhere stating that using quotes is necessary for files with spaces? |
vim $(fzf)
will not open files that have a space in the name. To fix that, use double quotes.