Re: is there a standard for getting a command's version number?

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

 



On Sat, 22 Dec 2007, Jacques B. wrote:

> Not at my Linux box so can't validate this, but could you get it
> from rpm -qa | grep {command_name}?  Doesn't the rpm package name
> always contain the version number?  If so at least the format would
> be more standardized thus easier to parse.

but the command name doesn't necessarily need to match the package
name from whence it came, as in:

  $ rpm -qf /bin/ls
  coreutils-6.9-12.fc8

obviously, this isn't a life-or-death issue but, given the frequency
with which people might want to check the version number of a command,
i am a bit surprised that there's no GNU-wide standard option
(--exactversion?) that just gives it to you.

did no one ever suggest such a thing?  just curious.

rday

p.s.  one option is to just use rpm and queryformat, as in:

$ rpm -q --queryformat "%{VERSION}\n" $(rpm -qf $(which grep))
2.5.1
$

or something to that effect.
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux