in reply to Re: Desperate Coding Tidy-up
in thread Desperate Coding Tidy-up

Hi There,

Thanks for the pointers and snippets, they are much appreciated.

The postfix file looks like this:
foo.com VIRTUALDOMAIN @foo.com bob bob@foo.com bob chris@foo.com chris bar.com VIRTUALDOMAIN @bar.com bob bob@bar.com bob chris@bar.com chris

I need to: use the variable $domain which will contain e.g "foo.com", seek to the line that starts with foo.com, move down two lines, do a return, and then print $username\@$ddomain\t$username. So if the username is don and the domain is bar.com, i need the code to locate the line starting with bar.com, drop down to lines, do a return and then print so the postfix file will then look like:
foo.com VIRTUALDOMAIN @foo.com bob bob@foo.com bob chris@foo.com chris bar.com VIRTUALDOMAIN @bar.com bob don@bar.com don bob@bar.com bob chris@bar.com chris

Cheers