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

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

 



Robert P. J. Day wrote:
  frequently, i want to get the version number of a command to see if
it's new enough for what i need, but there doesn't seem to be any
GNU-wide standard for that.

  for example, if i want to know what version of "ls" i have, i can
do:

$ ls --version
ls (GNU coreutils) 6.9
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the
terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard Stallman and David MacKenzie.
$

  well, that's useful, but if all i'm after is the version number, i
have to run that through head, and strip the first part of the line to
get to the value i want, which is just "6.9".

  "gcc" at least supports the "-dumpversion" option:

$ gcc -dumpversion
4.1.2
$

  is there a reason there's no single GNU-standard option that simply
gives you that version number, so you can avoid all the head'ing and
sed'ing to get to it?

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

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

It is seldom I need the version of software. But when I do it seems that --version works all the time. The results are more than you wanted but who cares?

Karl


--

	Karl F. Larsen, AKA K5DI
	Linux User
	#450462   http://counter.li.org.
  PGP 7025 BB6C 7CC3 CFE7 43B2  1574 3279 EBB0 B626 2B7E

--
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