NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Parsing pkg_admin audit



Hello Aaron,

Aaron B. writes:
> [...]
> Is there a mode, or some other utility/combination of commands, to get
> the output of 'pkg_admin audit' in a machine-readable way - something
> like CSV/JSON/etc?
>
> A regular expression should be able to do it, but I'm hoping there's
> some format intended to be scripted.
> [...]

I would just pipe it to AWK (without any regular expression), e.g.
to have a corresponding TSV of them:

 | % pkg_admin audit |
 |   awk '{ pkg = $2; vuln_type = $5; url = $NF; print pkg "\t" vuln_type "\t" url }'


Home | Main Index | Thread Index | Old Index