[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: du and wc should be able to read arguments from a file

From: Dave Gotwisner
Subject: Re: du and wc should be able to read arguments from a file
Date: Fri, 19 Sep 2003 00:24:37 -0700

Jim Meyering wrote:

> "Dan Heller" <address@hidden> wrote:
> > Anyway, the other method is to support the "take the input from a file"
> > approach that Dave pointed out:
> Thanks for bringing this up.
> It would be useful to give du and wc options to make them
> read all file name arguments from a file.  Of course, if such
> a file were specified as `-', then it would read from stdin.
> However, before someone goes off to implement this, here
> are a few things to consider.
> If the format is simply one file name per line, then what about
> files with names containing a newline?
> One solution is to require that newlines and backslashes be backslash-escaped.
> Another is simply to require that file names be NUL (aka '\0') separated,
> like what find's -print0 option would output.
> In the interests of keeping things simple, I'm leaning toward the latter.

Rather than assume it just takes a list of files, I would suggest strongly that
whoever chooses
to implement this (if anyone does), they also allow it to take other options as
part of the file.
Literally, they should replace the "--process-file=foo" with the literal 
of the file foo,
not assuming they are files.  This gives a nice generic interface for scripting,
and as such, as
Jim says, any thing which needs to be escaped should be.  Maybe doing quote
to boot.

If someone does do this, to be consistent, I would recommend that it go, not in
core utils, but
in getopt.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]