Mait
Mait

Reputation: 103

Is it properly quoted when I using '*' or '**/*' in bash?

find -name '*.jpg' -print0 | xargs -0 qiv

qiv **/*.jpg

both are safely escaped and delivered to qiv?

Upvotes: 0

Views: 27

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799440

Yes. In the first case, find is expanding the wildcard internally, and delivering results to xargs as it expects them. In the second, the shell is expanding them and passing each match as a separate argument. Both are correct (assuming shell support for **, and that the command line length maximum isn't exceeded).

Upvotes: 1

Related Questions