on Sat, 09 Nov 2002 05:21:16PM -0500, Stephen Gran insinuated:
> I have it mostly working the way I want (as you can see by the .sig
> below), but it's not yet maintenance free. The right column is
> fortune -s | fold -sw 48, but fold doesn't always deal with line breaks
> as expected, and leaves indented lines at longer than specified, so I
> have to manually correct the right margin. Any one have any special
> magic for this? I know I'm being lazy in asking, and could probably
> work out a perl incantation to deal with this
that's one of the things perl was made for -- practical extraction and
REPORT (i.e., formatting) language ... do something like
{
$name = "Stephen Gran";
$email = "steve@lobefin.net";
$url = "http://www.lobefin.net/~steve";
$fortune = `fortune';
write;
}
format STDOUT =
------------------------------------------------------------------------------
|@<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
$name $fortune
|@<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
$email $fortune
|@<<<<<<<<<<<<<<<<<<<<<<<<<<<< | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
$url $fortune
| | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
~~ $fortune
------------------------------------------------------------------------------
the '^' wraps your string around in paragraphs; the ~~ at the end
means "keep going until $fortune in empty. you don't even need that
if your fortunes are all 3 lines.
hth,
</nori>
--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ www.maenad.net
^`~'^
Attachment:
pgpxTEDJ6gQxQ.pgp
Description: PGP signature