rewriting config_*, xmalloc_fget*
Laurent Bercot
ska-dietlibc at skarnet.org
Thu Jun 16 20:37:09 UTC 2011
> There's no point in C programs reading the output of find -print0.
> It's trivial to call nftw yourself.
Unless said C programs are modular utilities. Like xargs.
For instance,
http://www.skarnet.org/software/execline/forbacktick.html
would have been unnecessarily difficult to write if it had had to
understand shell quoting.
> It's also trivial with the shell
> to transform shell-quoted form to null-delimited form:
>
> eval "printf '%s\0' $quoted"
Yes - if, again, you have access to a shell and a printf. Why
require a printf formatting pass and a shell parsing pass when
you can simply pipe the data to the next filter ? KISS please.
The shell is a hammer, but all data isn't nail-shaped. Don't
make the mistake of applying your favorite tool even when it's
not the best-suited for the job.
--
Laurent
More information about the busybox
mailing list