Skip to content
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

[BUG] Single quotes inside double quotes with exec on MSYS2 #1585

Open
1 task done
EJammy opened this issue Jul 2, 2024 · 0 comments
Open
1 task done

[BUG] Single quotes inside double quotes with exec on MSYS2 #1585

EJammy opened this issue Jul 2, 2024 · 0 comments
Labels

Comments

@EJammy
Copy link

EJammy commented Jul 2, 2024

Checks

  • I have read the troubleshooting section and still think this is a bug.

Describe the bug you encountered:

When running exec, single quote inside double quote doesn't seem to work:

$ fd -x echo "hello'world'"
helloworld ./b
helloworld ./b/file2.txt
helloworld ./file.txt

However, it is fine when there's a space in between:

$ fd -x echo "hello 'world'"
hello 'world' ./b/file2.txt
hello 'world' ./b
hello 'world' ./file.txt

Trying to escape with backslash yields weird results:

fd -x echo "hello\'world\'"
hello\world' ./file.txt
hello\world' ./b
hello\world' ./b/file2.txt

I also can not reproduce this bug on Linux.

Describe what you expected to happen:

Using find:

$ find . -exec echo "hello'world'" {} \;
hello'world' .
hello'world' ./b
hello'world' ./b/file2.txt
hello'world' ./file.txt

Using gnu parallel:

$ fd | parallel echo "hello\'world\'"
hello'world' b/
hello'world' b/file2.txt
hello'world' file.txt

What version of fd are you using?

fd 10.1.0

Which operating system / distribution are you on?

$ uname -srm
MINGW64_NT-10.0-22631 3.5.3.x86_64 x86_64
@EJammy EJammy added the bug label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant