From owner-freebsd-questions@FreeBSD.ORG Thu Aug 21 12:53:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B682106568C for ; Thu, 21 Aug 2008 12:53:06 +0000 (UTC) (envelope-from barry.byrne@wbtsystems.com) Received: from hermes.wbtsystems.com (hermes.wbtsystems.com [193.120.231.28]) by mx1.freebsd.org (Postfix) with ESMTP id C7AB48FC1C for ; Thu, 21 Aug 2008 12:53:05 +0000 (UTC) (envelope-from barry.byrne@wbtsystems.com) Received: by hermes.wbtsystems.com (Postfix, from userid 80) id 38DD9F741A; Thu, 21 Aug 2008 13:52:59 +0100 (IST) Received: from 79.97.54.210 ([79.97.54.210]) by webmail.wbtsystems.com (Horde Framework) with HTTP; Thu, 21 Aug 2008 13:52:59 +0100 Message-ID: <20080821135259.156611o45aw86x4g@webmail.wbtsystems.com> Date: Thu, 21 Aug 2008 13:52:59 +0100 From: "Barry Byrne" To: "Steve Bertrand" References: <48AD63B7.8090107@ibctech.ca> In-Reply-To: <48AD63B7.8090107@ibctech.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.2) / FreeBSD-6.2 Cc: freebsd-questions@freebsd.org Subject: Re: sed/awk, instead of Perl X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 12:53:06 -0000 Quoting "Steve Bertrand" : few passes over a few files. > > To put it plainly, can anyone, if it's possible, provide a single > line sed/awk pipeline that can: > > - read email addresses from a file in the format: > > user.name TAB domain.tld > > - convert it to: > > user_name@example.com > > - write it back to either a new file, the original file, or to STDOUT > > Regards, cat file.txt | ( while read user domain; do echo "$user@$domain"; done ) - barry