Demonstrate how to detect the OS type in script to change parameters to commands.
REF: chrisguest75/docker_examples/10_distro_versions/README.md
# use decision logic based on OS version
./detect-os.sh
docker buildx build --progress=plain -f Dockerfile.os -t detect-os .
docker run --rm detect-os
# kernel versions
uname -a
cat /proc/version
# distro versions
cat /etc/os-release
# show kernel compile options
zcat /proc/config.gz
# package versions
apt list
apt update
apt list --upgradable
# kernel versions
uname -a
cat /proc/version
# distro versions
cat /etc/os-release
# package versions
apk list --installed
apk list -u
# kernel versions
uname -a
cat /proc/version
# distro versions
cat /etc/os-release
# package versions
apk list --installed
apk list -u
# kernel versions
uname -a
cat /proc/version
# distro versions
cat /etc/os-release
# package versions
yum list --installed
yum list --upgrades
sw_vers -productName
sw_vers -productVersion
sw_vers -buildVersion
echo "Hostname (VPN): $(scutil --get HostName)"
echo "LocalHostName: $(scutil --get LocalHostName)"
# in cmd prompt
ver
# versions in powershell
[System.Environment]::OSVersion