# Check if the given program is installed. Returns 0 if it exists, 1
# otherwise; so it can be used in if.
installed() {
- which $1 | grep -E '^/' > /dev/null
+ which $1 2>&1 | perl -ne 'if (not m{^/}) { exit 1 }'
}
# Prints the current OS. Supported are Debian (debian), Gentoo (gentoo) and