c++ - rpm -q -> 只查询描述

标签 c++ linux command-line rpm

我可以使用

查询有关 rpm 包的信息
rpm -qi <rpm-package-name>

查询结果示例:

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

但我只想查询Description。那可能吗? 这样做的原因是我想在 C++ 程序中处理此信息(描述)(我使用 popen() 执行此操作)。

也许是这样的:

rpm -qi -Description expect-5.45-16.1.3.i586

最佳答案

这是正确的解决方案:

rpm -q --queryformat '%{DESCRIPTION}\n'  expect-5.45-16.1.3.i586

关于c++ - rpm -q -> 只查询描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47901964/

相关文章:

python - 使用 python 更改 mac 的终端主题

c++ - "get() const"与 "getAsConst() const"

c++ - 在 C++ 中转发声明枚举

android - 保留通过 native 代码创建的egl上下文

linux - 谁在 fork 处先跑,结果相互矛盾

linux - 使用 SSH 在桌面上打开应用程序

linux - 如何简洁地执行 Linux 嵌套命令行?

linux - *nix 有平衡方案 REPL 吗?

C++:如何将字符串转换为起始字符可以更改的 float ?

javascript - 每 10 秒运行一次 node.js 脚本