Layer-free shell syntax [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2011-03-16 11:36
Layer-free shell syntax
LinkReply
[personal profile] simontWed 2011-03-16 11:47
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.
Link Reply to this | Parent | Thread
[personal profile] j4Wed 2011-03-16 12:06
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!).
Link Reply to this | Parent | Thread
[personal profile] simontWed 2011-03-16 12:19
Ooh, I didn't know about grep -Z! Thank you.

(But apart from find -print0, grep -Z, the aqueducts and public sanitation, what have GNU ever done for us? :-)
Link Reply to this | Parent | Thread
[personal profile] ewxWed 2011-03-16 22:22
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…
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]