From owner-freebsd-questions@FreeBSD.ORG Sun Nov 30 17:45:38 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 9DD3B1065677 for ; Sun, 30 Nov 2008 17:45:38 +0000 (UTC) (envelope-from prad@towardsfreedom.com) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 767E38FC0A for ; Sun, 30 Nov 2008 17:45:38 +0000 (UTC) (envelope-from prad@towardsfreedom.com) Received: from pd5ml1no-ssvc.prod.shaw.ca ([10.0.153.166]) by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 30 Nov 2008 10:45:37 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=0 a=KoDPwd6_AAAA:8 a=KkW6-k5YubuMPo-5H-EA:9 a=kE664f_7sJSekuffmGYA:7 a=tXZOJdQCE6MPSSUFqgVBFr0nxocA:4 a=Sllw8v0m4fwA:10 Received: from s0106000d935c7902.du.shawcable.net (HELO gom.home) ([70.67.160.177]) by pd5ml1no-dmz.prod.shaw.ca with ESMTP; 30 Nov 2008 10:45:37 -0700 Received: from gom.home (localhost [127.0.0.1]) by gom.home (Postfix) with ESMTP id 3DCCC1701E; Sun, 30 Nov 2008 09:45:29 -0800 (PST) Date: Sun, 30 Nov 2008 09:45:28 -0800 From: prad To: freebsd-questions@freebsd.org Message-ID: <20081130094528.3bdf8782@gom.home> In-Reply-To: <4932CA0D.8080109@mykitchentable.net> References: <4932CA0D.8080109@mykitchentable.net> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Drew Tomlinson Subject: Re: Regular Expression Help 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: Sun, 30 Nov 2008 17:45:38 -0000 On Sun, 30 Nov 2008 09:14:53 -0800 Drew Tomlinson wrote: > I'm attempting to take an ldiff file and flip first/last name order. > you can try using sh (i'm using zsh) file data.txt has the following: joe brown joe brown-smith file t.sh is coded as: #!/usr/local/bin/zsh # while read var; do f=${var% *} l=${var#* } echo $l, $f done < $1 then you just run it as t.sh data.txt -- In friendship, prad ... with you on your journey Towards Freedom http://www.towardsfreedom.com (website) Information, Inspiration, Imagination - truly a site for soaring I's