#!/usr/bin/env bash set -o nounset set -o errexit cpu="$(yaml2json < _machines/"$(hostname --short)".yml | jq --raw-output .cpu)" gpu="$(yaml2json < _machines/"$(hostname --short)".yml | jq --raw-output .gpu)" if [[ "${cpu}" ]] ; then readarray -d $'\0' -t cpu_packages < <(]*}" "${makedepends[@]%%[<=>]*}" "${pkgname}") done declare -a packages_to_remove=() readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \ <(cat \ <( 0 )) ; then sudo pacman -Rcns "${packages_to_remove[@]}" "${@}" || exit $? exit 123 fi