On Don, 2011-06-16 at 16:12 -0400, Rich Felker wrote:
[....]
> There's no point in C programs reading the output of find -print0.
> It's trivial to call nftw yourself. It's also trivial with the shell
Sometimes one has to use the output of some script/tool which can't
easily be changed ....
> to transform shell-quoted form to null-delimited form:
>
> eval "printf '%s\0' $quoted"
>
> Transformation in the other direction is virtually impossible using
> the shell and standard utilities - the only way would be to pipe
I wouldn't call
echo -n $quoted | tr "\000" "\012"
(which converts \0 into \n) impossible and I consider "tr" a standard
utility.
And I never read/tries/played with bash and it's source (or other
shells) to see if
echo ${quoted//\000/\012}
(or something similar) does the same.
> through "od" to transform the data to octal, fixup the \000's, and
> then convert back with "printf", which would be incredibly
> inefficient.
ACK.
Bernd
--
Bernd Petrovitsch Email : [email protected]
LUGA : http://www.luga.at
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox