Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a shame that 'glob is a generator' did not become the standard way of doing things. It would save so much headache (and make writing programs easier) if

  command *
(or similar syntax) expanded to something like

  command /some/fd
where calls to

  read(/some/fd)
produced

  "expansion_one␀expansion_two␀expansion_three␀...␀"
Though exactly how one would plumb this is its own question.


This is possible if you use "xargs" (which runs a command multiple times with different subsets of the arguments), although it is most useful if commands are aware of null-separation (e.g. old-style "find ... -print0 | xargs -0", before "find" added the "+" option).


Yes, 'find -print0' / 'xargs -0' is the workaround that guided my thinking. (Which was essentially "how can I make 'find -print0 |' easy enough to use all the time, and flexible enough for more than one glob at a time?")




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: