1 2 3 4 5 6 7
#!/bin/bash # Detect is a package is installed or in a database pacman -Qqi $1 >/dev/null 2>&1 || \ pacman -Sqi $1 >/dev/null 2>&1 exit $?