[Top][All Lists]

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

Re: What is the opposite of 'printf'?

From: Bob Proulx
Subject: Re: What is the opposite of 'printf'?
Date: Mon, 11 Dec 2006 23:16:52 -0700
User-agent: Mutt/1.5.9i

Matthew Woehlke wrote:
> 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.)

Take a look at makeself.


> 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.

That could be a very large file.

If you are just looking for ideas then I found codegroup interesting.



reply via email to

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