Wrongly, of course :-) For this purpose the GNU version of xargs has the -0 switch which makes it expect to read filenames from standard input separated by NUL, and GNU find has a corresponding option -print0 which outputs in that format. But of course you can only use those if you know you'll never have to port to anything non-GNU, and nothing other than find will output in that format, and in any case the whole system ought ideally to have been set up so that it worked reliably without a user having to remember to add the special and obscure "work reliably" flag.
nothing other than find will output in that format
grep -Z?
I suspect I'm missing the point though... :-} not entirely sure I understand about layers (though it's fascinating & I will re-read to see if it's clearer the second time!).
The BSD find/xargs have -print0/-0 as well, and perl has a -0 option (though of course you could set $/ manually). I think there are other things that this format has spread to also…
-0
switch which makes it expect to read filenames from standard input separated by NUL, and GNU find has a corresponding option-print0
which outputs in that format. But of course you can only use those if you know you'll never have to port to anything non-GNU, and nothing other than find will output in that format, and in any case the whole system ought ideally to have been set up so that it worked reliably without a user having to remember to add the special and obscure "work reliably" flag.grep -Z?
I suspect I'm missing the point though... :-} not entirely sure I understand about layers (though it's fascinating & I will re-read to see if it's clearer the second time!).
(But apart from find -print0, grep -Z, the aqueducts and public sanitation, what have GNU ever done for us? :-)