pkginfo |grep VRTSobgui
pkgparam NOVLsubag VERSION 8.7.3.3
rpm -qi NOVLsubag 2>/dev/null | grep "Version" | awk '{print $3}' 8.7.3.3
Or, by querying for only the desired details:
rpm -q --qf %{VERSION} NOVLsubag 8.7.3.3
pkgparam -d NDSserv.pkg NDSserv VERSION 8.7.3.2
rpm -qp --qf %{VERSION} NDSserv-8.7.3.2-35.i386.rpm 8.7.3.2
% pkgchk -l -p /usr/lib/sendmail Pathname: /usr/lib/sendmail Type: regular file Expected mode: 4555 Expected owner: root Expected group: bin Expected file size (bytes): 650720 Expected sum(1) of contents: 22626 Expected last modification: Apr 07 04:13:53 1999 Referenced by the following packages: SUNWsndmu Current status: installed %*Plagarized from a Solaris Command Reference
rpm -qf /usr/sbin/sendmail sendmail-8.12.11-4.RHEL3.1