sharkdp / fd

A simple, fast and user-friendly alternative to 'find'
Apache License 2.0
34.14k stars 815 forks source link

Add ---exec-shell option #1406

Open tmccombs opened 1 year ago

tmccombs commented 1 year ago

As mentioned in https://github.com/sharkdp/fd/issues/1354#issuecomment-1657208919

There are many cases where it is desirable to use --exec or --exec-batch` with a shell command, including having access to aliases and shell functions, being able to use pipes and redirection, etc.

Having an option that automatically handles the boilerplate of $SHELL -c for you would make those use cases a lot more convenient.

Before jumping in and implementing this though, there are some open questions I would like answered:

j-lakeman commented 11 months ago

e.g. a self-defined function like that:

function trash
        gio trash $argv
end
fd --type file --type empty --exec trash                   ✘ 1
[fd error]: Command not found: trash