I\'m about to write a shell script to detect if several homebrew packages are installed in the system. Is there a way to use a brew command to achieve that?
for pkg in macvim ngrep other needed packages; do
if brew list -1 | grep -q "^${pkg}\$"; then
echo "Package '$pkg' is installed"
else
echo "Package '$pkg' is not installed"
fi
done