Skip to content

Os

Index

os::release_field

Print the value of a named field from /etc/os-release. Output: stdout — field value, or empty string if the field is absent

Arguments

  • $1 (field): name (e.g. ID, VERSION_CODENAME)

os::id

Print the OS identifier from /etc/os-release (e.g. "ubuntu", "fedora"). Output: stdout — value of the ID field shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

os::codename

Print the OS version codename from /etc/os-release (e.g. "jammy"). Output: stdout — value of the VERSION_CODENAME field shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

os::arch

Print the system architecture as reported by dpkg (e.g. "amd64"). Output: stdout — dpkg architecture string shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

os::is_arch

Return true if the current OS is Arch Linux. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_cachyos

Return true if the current OS is CachyOS. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_fedora

Return true if the current OS is Fedora. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_debian

Return true if the current OS is Debian. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_ubuntu

Return true if the current OS is Ubuntu. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_leap

Return true if the current OS is openSUSE Leap. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false

os::is_tumbleweed

Return true if the current OS is openSUSE Tumbleweed. shellcheck disable=SC2120 # called with no args by callers, shellcheck can't see all call sites

Function has no arguments.

Exit codes

  • 0: if true
  • 1: if false