I can query the informations about a rpm-package with
rpm -qi <rpm-package-name>
Example-Result of a Query:
tfaa004:/sm/bin # rpm -qi expect-5.45-16.1.3.i586 Name : expect Version : 5.45 Release : 16.1.3 Architecture: i586 Install Date: Di 27 Jun 2017 15:31:08 CEST Group : Development/Languages/Tcl Size : 674166 License : SUSE-Public-Domain Signature : RSA/SHA256, Do 25 Sep 2014 11:42:26 CEST, Key ID b88b2fd43dbdc284 Source RPM : expect-5.45-16.1.3.src.rpm Build Date : Do 25 Sep 2014 11:42:16 CEST Build Host : cloud120 Relocations : (not relocatable) Packager : http://bugs.opensuse.org Vendor : openSUSE URL : http://expect.nist.gov Summary : A Tool for Automating Interactive Programs Description : Expect is a tool primarily for automating interactive applications, such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect really makes this stuff trivial. Expect is also useful for testing these applications. It is described in many books, articles, papers, and FAQs. There is an entire book on it available from O'Reilly. Distribution: openSUSE 13.2
But I only want to query the Description. Is that possible? The reason for that is that I want to process this information (the Description) in a C++ Program (I do this with popen()).
Maybe something like this:
rpm -qi -Description expect-5.45-16.1.3.i586
Advertisement
Answer
This is the correct sollution:
rpm -q --queryformat '%{DESCRIPTION}n' expect-5.45-16.1.3.i586