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

-exec not working in find #95

Closed
torifat opened this issue Jun 10, 2012 · 7 comments
Closed

-exec not working in find #95

torifat opened this issue Jun 10, 2012 · 7 comments

Comments

@torifat
Copy link

torifat commented Jun 10, 2012

I tried to use-
find . -type f -name "*.mp3" -exec mv {} . /;

But, it is saying that mv can not find the file.

I switched to bash and it worked there.

Although, this is working just fine-
find . -type f -name "*.mp3"

I also tried to do the following but with no luck-
find /full/path -type f -name "*.mp3" -exec mv {} . /;

@ridiculousfish
Copy link
Member

It's not exec, it's the {}. fish expands empty braces, bash does not.

If you quote it '{}', it should work as you expect.

I'll leave this open to consider matching bash's behavior here. It's not clear to me that expanding empty braces is desirable.

@torifat
Copy link
Author

torifat commented Jun 10, 2012

Thanks 😄

@torifat torifat closed this as completed Jun 10, 2012
@hrldcpr
Copy link

hrldcpr commented Nov 11, 2013

@torifat did you decide that expanding empty curly braces was worth keeping?
Having fish shell not work "out of the box" with basically all find -exec commands seems problematic—it almost forced me to switch shells until I found your '{}' workaround.

@BarbzYHOOL
Copy link

Why isn't this working by default?? this is really really really really really annoying (I kept switching to bash for this, until i decided to google the issue, but still can't easily copy paste)

@faho
Copy link
Member

faho commented Jul 5, 2018

@BarbzYHOOL: See #1109, which is fixed in 3.0, by not expanding a literal {} anymore.

Also, please don't just spam old issues.

@BarbzYHOOL
Copy link

BarbzYHOOL commented Jul 5, 2018

spam? one message is not spam

I feel like opening a new issue to ask this question is way more spammy (and time wasting :P)

damnit I need 3.0 in my life, thank you!!

@faho
Copy link
Member

faho commented Jul 7, 2018

spam? one message is not spam

@BarbzYHOOL:

Sorry, that came on much stronger than I intended.

What I meant was that this issue is quite old, so resurrecting it isn't really all that great.

I feel like opening a new issue to ask this question is way more spammy (and time wasting :P)

I would actually prefer a new issue over random questions all over the place. When an issue is still "hot", as in it is either open or has been closed semi-recently, or when your question is "why does the enhancement that was added here not work for me", then it's alright to reuse an existing issue.

But when it's essentially a request to rethink something that was closed years ago, then a new issue is the right way to go.

Either that, or try gitter.im/fish-shell/fish-shell first.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants