bug-coreutils
[Top][All Lists]
Advanced

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

Re: What is the opposite of 'printf'?


From: Matthew Woehlke
Subject: Re: What is the opposite of 'printf'?
Date: Wed, 13 Dec 2006 11:19:38 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.0

Bob Proulx wrote:
Matthew Woehlke wrote:
So my original question remains... would anyone be interested in considering 'unprintf' for inclusion in coreutils? (Note: I /am/ volunteering to write and maintain it.)

If your requirement is that the command must already exist on the
system then that definitely defeats the addition of a new command.

No, my requirement is only that the /de/coder already exist. 'printf' is so far the only thing I have thought of that consistently /does/, but there is no inverse for it. So I had to write my own. (Which, btw, I already did; I am fishing to see if there is any interest in me polishing it up and sharing it.) I only need the /en/coder to produce the script in the first place, so whatever special tools are needed for that is not an issue.

Actually, I thought of another good reason for 'unprintf'; since it is mainly converting non-printing characters into escape sequences, it can easily (mostly, don't convert '%'s) be made to produce something that a C compiler will understand (that will produce the same data). So you could /also/ use it to dump raw binary data into the source code of a C[++] program. base64/uuencode would not work for this purpose because you would have to write a decoder in the program to make use of the data.

Also uuencode/uudecode is many times more standard than some not yet
created command.

But apparently not as standard as 'printf'. :-)
At least, not in terms of actually being installed (go figure).

--
Matthew
"unsubscribe me plz!!" -- Newbies





reply via email to

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