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

Re: Debian 2.0: Checklist automated



On Thu, 15 Jan 1998 bhmit1@mail.wm.edu wrote:

> P.S. Any sed expert who can think of how to change the e-mail addresses
> into mailto links with a sed command (or any command) could do me a huge
> favor by sharing your wisdom.  See http://bhmit1.home.ml.org/deb and view
> one of the html sources.

a regular expression such as the following:
    s/\(.*\)/<A HREF="mailto:\1";>\1<\/A>/

should convert a string, like:
    foo@bar.com
into 
    <A HREF="mailto:foo@bar.com";>foo@bar.com</A>

the same regular expression should work with sed and awk. 

the syntax for perl is slightly different. use just (...) instead of
\(...\), and use $1 instead of \1 for the back-references..

    s/(.*)/<A HREF="mailto:$1";>$1<\/A>/

the RE could be made smarter, but this will handle simple cases.

use in a sh script like so:

    #! /bin/sh

    ADDR="cas@taz.net.au"
    LINK=$( echo "$ADDR" | sed -e 's/\(.*\)/<A HREF="mailto:\1";>\1<\/A>/' )


craig

--
craig sanders


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: