Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.os.misc Subject: Re: Globbing Message-ID: <10459:Mar1408:23:3191@kramden.acf.nyu.edu> Date: 14 Mar 91 08:23:31 GMT References: <00085@meph.UUCP> <5946:Mar1122:11:0691@kramden.acf.nyu.edu> <44190@cos.com> Organization: IR Lines: 35 In article <44190@cos.com> fetter@cos.UUCP (Bob Fetter) writes: > In article <5946:Mar1122:11:0691@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >I and many others have been pushing for utilities that understand > >(null-terminated) lists of filenames passed through a descriptor. Then > >as long as echo * (or echo0 *) works, you can pass arbitrarily many > >filenames to any program. You can already do this with find, of course, > >though its syntax is more powerful and hence less concise. > Independent of the other items raised in this thread, what is meant > by arguments "passed through a descriptor"? Exactly what happens to the filename arguments in, e.g., find / -name core -print0 | xargs -0 rm They are passed from find to xargs through a descriptor. Is that clear enough? > Having worked on/with systems with descriptor *paired* argument lists > (case in point Multics, where the argv[] pointer array was coupled with > a descriptor[] pointer array, No, no, no, no. That's exactly the wrong model for this sort of problem. One part of the ``UNIX philosophy''---namely pipelines---says that you should work with data bit by bit if possible, rather than collecting it all together, storing it somewhere, and processing in stages. I'm saying that this can be fruitfully applied to filename arguments. Instead of collecting all the arguments together in one argv[] line, pass them through a descriptor in some sensible format. This eliminates the need for xargs and neatly solves various problems. There are already many programs---notably various make versions---that already take file lists from input. Hopefully the trend will continue. ---Dan