[ale] Utility to word-wrap plain text?

Chuck Huber chuck at cehuber.org
Wed Mar 28 13:40:56 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ale-request at ale.org wrote:
...

> Message: 2
> Date: Wed, 28 Mar 2007 09:37:43 -0400
> From: "Cox, Danny" <dcox at icc.net>
> Subject: Re: [ale] Utility to word-wrap plain text?
> To: "Atlanta Linux Enthusiasts" <ale at ale.org>

> 	Try 'fmt'.
> Danny Cox

Danny,

fmt did it.  Thanks.

Charles had suggested fold.  However it is not word-aware in that it cut the
line in mid-word.


Here's the resulting code:
#
# Evaluate the form, placing form variables in the environment
# under the name FORM_xxx
# This can only be called once since it handles form submission
# through POST. i.e. it reads stdin for form elements.
#
e
`eval proccgi $*`
...
echo "${FORM_message}" | sed -e 's/^M/\n/g' | fmt --split-only --width=72
...

Thanks for the help.

Enjoy,
    - Chuck

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGCqioiR3HaLbYCa4RAjfkAJwPK3qiNfdEFELcbmNX/XJ2NH8GeACg+Lbb
aly7JypH2aNJWgHlYrwnTiI=
=jiyh
-----END PGP SIGNATURE-----



More information about the Ale mailing list