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
Add an option to quote files in output for easier copy/pasting #1365
Comments
Here's a quick way to do that, using bash's $ fd '\.rs$' -X bash -c 'printf "%q\n" "$@"' bash |
TIL about FWIW: Using |
One issue with that is that different shells have slightly different quoting rules. Which one do we use? |
All of the major shells I've used use the same basic
Automagically does quoting for me. I wonder how |
FWIW it looks like this is a |
This has been open for almost two months and not even a single comment from the devs? |
There have been two. @tavianator and I are both maintainers. My current inclination is that this is out of scope for fd. I might be able to be convinced otherwise, but I would need a compelling use case for why it is necessary. I'd also like to point out that using bash may not be necessary. The version of the printf executable that is part of GNU coreutils also supports the
And if you want to store the results in a bash array you can do this: FS=$'\0' arr=($(fd -0 ...))
# or
readarray -d $'\0' arr <(fd -0 ...) |
I have some files with spaces/quotes in the names and I would like
fd
to quote the output files appropriately to make copy/pasting/chaining easier. My use case is to search for a couple of files and then copy/paste a subset of the found files to another command. If the file contains special characters it makes copy/pasting more complicated.If I use vanilla
fd nova
I get:The first will require quoting to work with the spaces, and the second will not.
If use
fd nova -l
I get:Note that the filename is automatically quoted as needed, which is what is 90% of I want. Is there a way to get this functionality without the
ls
style details? I only need the filename.The text was updated successfully, but these errors were encountered: