X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=lib.sh;h=49ce998660f3132b0b33d2bbca86e5ac936719f6;hp=da00cce8d2c9be6e4b13f77bbe638bb8718eb1de;hb=f89f49df44d2d04eac338ead2d0843304414889e;hpb=de7a0a45d872450fc96614c51a1ad2670d01be5a diff --git a/lib.sh b/lib.sh index da00cce..49ce998 100644 --- a/lib.sh +++ b/lib.sh @@ -11,7 +11,7 @@ unset LS_COLORS # 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