xargs just working with built in functions
问题 I am trying to speed up the processing of a database. I migrated towards xargs. But I'm seriously stuck. Piping a list of arguments to xargs does not work if the command invoked by xargs isn't a built in. I can't figure out why. Here is my code: #!/bin/bash list='foo bar' test(){ echo "$1" } echo "$list" | tr '\012' '\000' | xargs -0 -n1 -I '{}' 'test' {} So there is no output at all. And test function never gets executed. But if I replace "test" in the "xargs" command with "echo" or "printf"