Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2013 06:16:19 +0000
From:      Ben Morrow <ben@morrow.me.uk>
To:        freebsd-stable@freebsd.org
Subject:   Re: BIND segway -> python -> first-class ports
Message-ID:  <20131212061615.GA28292@anubis.morrow.me.uk>
In-Reply-To: <38856510-A2D9-41E6-8CDC-ED282BDA933A@gsoft.com.au>
References:  <622122.74675.bm@smtp120.sbc.mail.gq1.yahoo.com> <20131210224915.GA55638@funkthat.com> <CAN6yY1tSqbrkt5bkjhDW6npT4PAXmMck0Xco%2BERwBE=wkkBDBQ@mail.gmail.com> <52A82099.9080100@bluerosetech.com> <B62F85D0-89E6-4FF8-ADE4-5025FB360462@gsoft.com.au> <D0F85D74-E727-4487-AEA1-B9C16660192E@fisglobal.com> <0EC3A50D-A6BE-4F3B-87D6-AB0470F0BA64@gsoft.com.au> <4174A92E-F202-4FFB-BFED-C38A9D0A7F91@fisglobal.com> <0D92E13A-F869-492C-852B-37A0BFB1674C@gsoft.com.au> <E4058C5F-9360-4A1D-BFB6-4658FC8D5945@fisglobal.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoth "Daniel O'Connor" <doconnor@gsoft.com.au>:
> 
> On 12 Dec 2013, at 12:24, Teske, Devin <Devin.Teske@fisglobal.com> wrote:
> >> Thanks, if only I'd know about this 6 months ago :)
> > 
> > I just wrote it from scratch, so didn't exist until today ;D
> 
> Hah nice, although I imagine there is plenty of legal XML it can't parse.
> 
> That plays to another point about this sort of work - it's very hard to
> write shell script that will work properly in all cases (things like
> spaces, or even newlines and unprintable characters in filenames).

While I wouldn't want to encourage the idea of standardising on XML,
libbsdxml (a copy of expat) is present in base, so it would be
straightforward to write a small utility which parsed XML entirely
correctly and extracted some requested information into shell variables.
(It would have to emit shell to be evalled, of course, just as getopt(1)
does.) It would also be possible to extend, say, awk to handle XML
natively.

Ben




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131212061615.GA28292>