foo() { bar --baz "$@"; frob --baz "$@"; }; find . -print0 | xargs -0 foo
find . -print0 | xargs -0 sh -c 'bar --baz "$@"; frob --baz "$@";' --
Shell functions are only known to the shell. External commands like xargs, su and sudo do not recognize shell functions.
xargs
su
sudo
Instead, the function contents can be executed in a shell, either through sh -c or by creating a separate shell script as an executable file.
sh -c
None.
There was an error while loading. Please reload this page.