.dotfiles/.bin/sh/orphans.sh
2025-03-24 12:47:13 -04:00

19 lines
286 B
Bash
Executable file

#!/bin/sh
# Check for orphans then asks for removal
{
while [[ $(pacman -Qtdq) ]];
do
pacman -Qtdq;
read -p "Remove orphaned packages? [y/n]:" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo pacman -R $(pacman -Qtdq)
elif [[ -n $(pacman -Qtdq) ]];
then
exit
fi
done
}