(Sorry this isn't exactly the right list, but this feels like a problem coreutils should solve, and I don't see gmane carrying anything better.)

I am looking for a way to convert binary data to a format that 'printf' will understand (and more importantly, from which '<something> | sed 's/\\/\\\\/g' | xargs printf' will produce the same output as the input). Am I missing such a utility, or might this be an opportunity for me to write 'unprintf' for coreutils? ('od -An -c' gets close, but still needs some complex parsing if it is to round-trip.)

The objective is to be able to reproduce a binary file from an 'editor friendly' shell script. I know base64 could do this, except that base64 is not portable (even to pre-6.x GNU coreutils), whereas printf is IIRC required by POSIX.

--
Matthew
"Lost a planet, Obi Wan has? How embarrassing..."
 -- Yoda (Star Wars II: Attack of the Clones)



_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to