I'm both writing Makefiles and setting up Docker images for building in a CI environment. In these various scripts I want to print the version of the tools I'm setting up and/or using.
gcc --version
shows the simple version number and some copyright and license information. Example output on my machine:
$ gcc --version
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Is there a simpler way to get just the version information without parsing this output?