Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 837

Comment by Kamil Maciorowski on `find`-like tool pruning most directories along a golden path

$
0
0
@gallais Yes, find logs/u*/p1/q1/r1 -name info does require a shell to expand the pathname expansion pattern. In general you can run a shell programmatically. Instead of an array of arguments for find you need an array of arguments for sh. It can be (starting from argv[1]) -c, exec find logs/u*/p1/q1/r1 -name info. Or it may be -c, exec find logs/u*/p1/q1/r1 "$@", sh, -name, info; this allows you to add more arguments to find as array members, not by embedding them in the shell code (which may require quoting or escaping and allows code injection if done poorly).

Viewing all articles
Browse latest Browse all 837

Trending Articles