A Challenge to Sed Adepts

Mark Buda root at chessene.UUCP
Sun May 28 08:52:56 AEST 1989


Here's a couple problems, possibly in order of increasing difficulty:

1) Write a sed script that takes as input decimal numbers, one to a line,
and converts them to hexadecimal. Or the other way around.

2) Write a sed script that takes as input decimal numbers, one to a line,
and adds them up. It can produce the final total, a running total, or
whatever. As long as it adds them up.

3) Same as #2, but do it with binary numbers.

4) Write a sed script that takes as input two decimal numbers, one to a line,
and multiplies them. (And outputs the product, of course.) Or prove that it
can't be done.

5) Same as #5, but do it with binary numbers.

If anybody gets #4, I will be truly amazed. (If *I* get #4, I will be even
more truly amazed.) Programs that fail due to limitations of sed will be
considered valid (if they actually work). Mail your submissions to the address
given below, or, if it bounces (as it very well might) consider posting them.
The winner for each problem is the person with the first correct solution.
In the event of not being really sure who was first, it's a tie.

No prizes, sorry :-)

(What a big waste of time this is)

Mark Buda
hermit at chessene.uucp
hermit%chessene.uucp at uunet.uu.net
...!rutgers!bpa!vu-vlsi!devon!chessene!hermit
devon.lns.pa.us!chessene!hermit



More information about the Comp.unix.wizards mailing list