1 2 3 4 5 6 7 8 9 10 11
#! /usr/bin/bash makepkg -f newest_file=$(find . -name "terraform-*.pkg.tar.zst" | sort -n | tail -n 1) echo $newest_file # Prints the filename sudo pacman -U "$newest_file" # Uses the filename in another command # clean up makepkg --check --clean build -f rm -f *.tar.zst rm -f *.zip