Don't pipe into grep, just use -xvivek said:Code:pkg_info | grep -i php
pkg_info -Ix php
portversion -v (from ports-mgmt/portupgrade) is a lot faster (about 6s vs. 70s here).SirDice said:Another nice one to use is pkg_version -v.
ale said:portversion -v (from ports-mgmt/portupgrade) is a lot faster (about 6s vs. 70s here).
Obviously, but if the OP is using portupgrade for upgrading his ports, portversion is free.SirDice said:It does require an additional port. Pkg_version and pkg_info are part of the base OS.
Apparent?SirDice said:I also doubt the speed. It takes a while for portversion to collect data before it produces output. Pkg_version immediately starts producing output. Which probably accounts for the apparent difference in speed.
$ time `pkg_version -v > /dev/null`
real 1m15.667s
user 0m41.320s
sys 0m12.968s
$ time `portversion -v > /dev/null`
real 0m7.332s
user 0m5.066s
sys 0m1.199s
ls -lac /var/db/pkg
ls -lac /var/db/pkg | tee -a vardMODA.YR
This thread is from 2009. It'sFWIW, I'm upgrading from 10.3 to 11.1, and both pkg_version and pkg_info result in "Command not found" errors.
pkg version
and pkg info
now.