Konstantin Vasilyev wrote:
>Here is requested content
># less virtual_to_transport
>#!/bin/sh
>/usr/bin/sed -E -e 's/(^[^#][^ \t]+[ \t]+).+$/\1local/' $1 >
>/usr/local/mailman/data/transport-mailman
>/usr/local/sbin/postmap /usr/local/mailman/data/transport-mailman
>
[...]
># less virtual-mailman
[...]
># LOOP ADDRESSES START
>[email protected]     mailman-loop
># LOOP ADDRESSES END
>
># STANZA START: mailman
># CREATED: Mon Dec 27 11:34:25 2010
>[email protected]              mailman
>[email protected]        mailman-admin
>[email protected]      mailman-bounces
>[email protected]      mailman-confirm
>[email protected]         mailman-join
>[email protected]        mailman-leave
>[email protected]        mailman-owner
>[email protected]      mailman-request
>[email protected]    mailman-subscribe
>[email protected]  mailman-unsubscribe
># STANZA END: mailman
>
># less transport-mailman
[...]
># LOOP ADDRESSES START
>mailman-l...@cellnetlocal
># LOOP ADDRESSES END
>
># STANZA START: mailman
># CREATED: Mon Dec 27 11:34:25 2010
>mail...@cellnetlocal
>mailman-ad...@cellnetlocal
>mailman-boun...@cellnetlocal
>mailman-conf...@cellnetlocal
>mailman-j...@cellnetlocal
>mailman-le...@cellnetlocal
>mailman-ow...@cellnetlocal
>mailman-requestlocal
>mailman-subscr...@cellnetlocal
>mailman-unsubscr...@cellnetlocal
># STANZA END: mailman

It appears that your sed does not recognize the '\t' escape as meaning
a 'tab' character, but rather recognizes it as a literal 't'. This
causes that portion of the pattern in parentheses to be treated as
(^[^#][^ t]+[ t]+) which in turn matches non-comment lines through the
first string of one or more 't' characters instead of matching through
the first string of whitespace. Thus you end up with the above instead
of

# LOOP ADDRESSES START
[email protected]     local
# LOOP ADDRESSES END

# STANZA START: mailman
# CREATED: Mon Dec 27 11:34:25 2010
[email protected]              local
[email protected]        local
[email protected]      local
[email protected]      local
[email protected]         local
[email protected]        local
[email protected]        local
[email protected]      local
[email protected]    local
[email protected]  local
# STANZA END: mailman

Fortunately, the whitespace in virtual-mailman is all spaces and no
tabs so you can change the expression in the sed command to

 -e 's/(^[^#][^ ]+[ ]+).+$/\1local/'

(i.e., just drop the two '\t's and it should work.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list [email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to