Versions

versions.bsh

A set of functions for determining the versions of specific programs.

git_version

Retrieves the version number of git.

Parameters:

[GIT] - The git executable that will be called. Can be overwritten to call a different executable. Defaults to git.

Output:

stdout - The git version number

docker_version

Retrieves the version number of docker.

Parameters:

[DOCKER] - The docker executable that will be called. Can be overwritten to call a different executable. Defaults to docker.

Output:

stdout - The docker version number

docker_compose_version

Retrieves the version number of docker compose.

Parameters:

[DOCKER_COMPOSE] - The docker compose command that will be called. Can be overwritten to call a different executable. Defaults to docker compose.

Output:

stdout - The docker compose version number

bash_version

Retrieves the version number of bash.

Parameters:

[BASH] - The bash executable that will be called. Can be overwritten to call a different executable. Defaults to bash.

Output:

stdout - The bash version number

glibc_version

Retrieves the version number of glibc currently uses by the OS

Parameters:

[LDD] - The ldd executable that will be called to determine glibc version. Can be overwritten to call a different executable. Defaults to /usr/glibc-compat/bin/ldd or ldd.

Output:

stdout - The glibc version number. Blank if it failed, which probably means glibc is not the default on this operating system.

glibc_version_manual

Retrieves the version number of a speific glibc library

Arguments:
  • $1 - Path to glibc, usually something like /lib64/libc.so.6

Output:

stdout - The glibc version number.

Example

libc_filename="$(ldconfig -p 2>/dev/null| \grep '^\s*libc\.so' | awk '{print $NF; exit}')"
echo "The glibc version is: $(glibc_version_manual "${libc_filename}")"
tar_version_info

Sets the vendor and version number of tar.

Parameters:

[TAR] - The tar executable that will be called. Can be overwritten to call a different executable. Defaults to tar.

Output:
  • tar_vendor - The tar vendor (BSD or GNU)

  • tar_version - The tar version number

openssh_version

Sets the vendor and version number of ssh.

Parameters:

[SSH] - The ssh executable that will be called. Can be overwritten to call a different executable. Defaults to ssh.

Output:
  • ssh_version - The ssh version number

  • ssl_vendor - The SSL vendor linked to ssh

  • ssl_version - The SSL version linked to ssh

nvcc_version

Determine the version of nvcc

Parameters:

[$NVCC] - The nvcc executable that will be called. Can be overwritten to call a different executable. Default: nvcc

Output:

stdout - Version of nvcc

version_txt_cuda_version

Parses the version.txt file left behind by some CUDA installs (Version 5.5 through 11.0. 11.0 only installs it as part of the “docs” package).

For versions of CUDA that are patched, the highest version number is returned.

Parameters:

[$1] - Filename of version.txt file. Default: Read from stdin

version_json_cuda_version

Parses the version.json file left behind by some CUDA installs (11.2 or newer).

Parameters:

[$1] - Filename of version.json file. Default: Read from stdin

gpg_version

Determine the version of gpg

Parameters:

[$GPG] - The gpg executable that will be called. Can be overwritten to call a different executable. Default: gpg2

Output:

stdout - Version of gpg

singularity_version_info

Sets the vendor and version number of singularity aka apptainer aka Singularity CE

Parameters:

[SINGULARITY] - The singularity executable that will be called. Can be overwritten to call a different executable. Defaults to singularity.

Output:
  • singularity_vendor - The singularity vendor (BSD or GNU)

  • singularity_version - The singularity version number