X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=lib.sh;h=5576bce23beab7f48e6cbd989ea6c243cb04a2b5;hb=672a0aaf51b19719eef061881b96880869082d2c;hp=582e1cffe66b1f440dcec0744c08f336fffeb8ea;hpb=f8404b8badbb07ea82dd043127838fd7ef562ba9;p=config%2Fdotfiles.git diff --git a/lib.sh b/lib.sh index 582e1cf..5576bce 100644 --- a/lib.sh +++ b/lib.sh @@ -11,6 +11,12 @@ unset LS_COLORS m4=`which m4` +# 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 +} + # Creates a symbolic link for file $1 in dirname of $2 with name of basenmae # $2. #