Versions
- versions.bsh
A set of functions for determining the versions of specific programs.
- git_version
Retrieves the version number of git
.
- Parameters:
[
GIT
] - Thegit
executable that will be called. Can be overwritten to call a different executable. Defaults togit
.- Output:
stdout - The
git
version number
- docker_version
Retrieves the version number of docker
.
- Parameters:
[
DOCKER
] - Thedocker
executable that will be called. Can be overwritten to call a different executable. Defaults todocker
.- Output:
stdout - The
docker
version number
- docker_compose_version
Retrieves the version number of docker compose
.
- Parameters:
[
DOCKER_COMPOSE
] - Thedocker compose
command that will be called. Can be overwritten to call a different executable. Defaults todocker compose
.- Output:
stdout - The
docker compose
version number
- bash_version
Retrieves the version number of bash
.
- Parameters:
[
BASH
] - Thebash
executable that will be called. Can be overwritten to call a different executable. Defaults tobash
.- Output:
stdout - The
bash
version number
- glibc_version
Retrieves the version number of glibc currently uses by the OS
- Parameters:
[
LDD
] - Theldd
executable that will be called to determine glibc version. Can be overwritten to call a different executable. Defaults to/usr/glibc-compat/bin/ldd
orldd
.- 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
] - Thetar
executable that will be called. Can be overwritten to call a different executable. Defaults totar
.- Output:
tar_vendor
- Thetar
vendor (BSD or GNU)tar_version
- Thetar
version number
- openssh_version
Sets the vendor and version number of ssh
.
- Parameters:
[
SSH
] - Thessh
executable that will be called. Can be overwritten to call a different executable. Defaults tossh
.- Output:
ssh_version
- Thessh
version numberssl_vendor
- The SSL vendor linked to sshssl_version
- The SSL version linked to ssh
- nvcc_version
Determine the version of nvcc
- Parameters:
[
$NVCC
] - Thenvcc
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 ofversion.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 ofversion.json
file. Default: Read from stdin
- gpg_version
Determine the version of gpg
- Parameters:
[
$GPG
] - Thegpg
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
] - Thesingularity
executable that will be called. Can be overwritten to call a different executable. Defaults tosingularity
.- Output:
singularity_vendor
- Thesingularity
vendor (BSD or GNU)singularity_version
- Thesingularity
version number