BIND segway -> python -> first-class ports
Ben Morrow
ben at morrow.me.uk
Thu Dec 12 06:21:46 UTC 2013
Quoth "Daniel O'Connor" <doconnor at gsoft.com.au>:
>
> On 12 Dec 2013, at 12:24, Teske, Devin <Devin.Teske at 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
More information about the freebsd-stable
mailing list