Regular Expression Help

prad prad at towardsfreedom.com
Sun Nov 30 09:45:38 PST 2008


On Sun, 30 Nov 2008 09:14:53 -0800
Drew Tomlinson <drew at mykitchentable.net> 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


More information about the freebsd-questions mailing list