#!/usr/bin/env bash updates=() if [[ -f /etc/debian_version ]]; then updates+=("[ APT: $(sudo apt update 2>/dev/null | grep packages | cut -d '.' -f 1 | awk '{print $1}') ]") fi if [[ -f /etc/redhat-release ]]; then updates+=("[ DNF: $(sudo dnf check-update | wc -l) ]") fi if command -v flatpak >/dev/null; then updates+=("[ Flatpak: $(flatpak remote-ls --updates | wc -l) ]") fi echo "${updates[*]}"