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

How to execute a sequence of commands ? #539

Closed
ngirard opened this issue Feb 26, 2020 · 2 comments
Closed

How to execute a sequence of commands ? #539

ngirard opened this issue Feb 26, 2020 · 2 comments

Comments

@ngirard
Copy link

ngirard commented Feb 26, 2020

A common scenario is to be able to execute, not only one but a sequence of commands, for every path of a search result.

For instance, the following command unpacks every zip file:

fd -e zip -x unzip

But how to remove the zip file after unpacking it successfully ?
The syntax I found to work, after some trial & errors, is:

fd -e zip -exec sh -c 'unzip "{}" && rm "{}"'

Is there a more intuitive way ?
In any case, I'd suggest to include a similar example to README file.

@sharkdp
Copy link
Owner

sharkdp commented Feb 27, 2020

Thank you for the feedback.

Unfortunately, that's not (yet) possible. See also: #406 (comment)

@sharkdp
Copy link
Owner

sharkdp commented Apr 2, 2020

I'm closing this in favor of #406

@sharkdp sharkdp closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants