#!/bin/bash declare -A TOOLS TOOLS+=( ["batcat"]=bat ["exa"]=exa ["fdfind"]=fd-find ["glow"]=glow ["readelf"]=binutils ["rg"]=ripgrep ["thefuck"]=thefuck ) declare -A PACKAGES for tool in ${!TOOLS[@]}; do if [[ ! -x "$(command -v $tool)" ]]; then PACKAGES+=("${TOOLS[$tool]}") fi done if [[ ${#PACKAGES[@]} > 0 ]]; then echo sudo apt install $(printf " %s" "${!PACKAGES[@]}") else echo All needed tools already installed. fi