Use "command" to get the bash_quote path.

Check if bash_quote is available.
This commit is contained in:
Jeremy Gardais 2015-09-08 02:09:37 +02:00
parent c7129b7953
commit 2f67336b49
1 changed files with 9 additions and 5 deletions

8
zshrc
View File

@ -300,12 +300,16 @@ alias ccal='var=$(cal); echo "${var/$(date +%-d)/$(echo -e "\033[1;31m$(date +%-
function bonjour() { function bonjour() {
MIN_TIME=$(date +%M) MIN_TIME=$(date +%M)
MODULO_MIN=$(($MIN_TIME % 2)) MODULO_MIN=$(($MIN_TIME % 2))
if [ $(command -v bash_quote) ]; then
if [ $MODULO_MIN -eq 0 ]; then if [ $MODULO_MIN -eq 0 ]; then
#echo Bonjour $USER, nous sommes le `date +"%A %e %B %Y"`, et il est : `date +"%H"` h `date +"%M"` | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1) #echo Bonjour $USER, nous sommes le `date +"%A %e %B %Y"`, et il est : `date +"%H"` h `date +"%M"` | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1)
/home/${USER}/bin/bash_quote | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1) command bash_quote | cowsay -f $(/bin/ls /usr/share/cowsay/cows -1 | head -n $(expr $$$(date +%s) % $(ls /usr/share/cowsay/cows | wc -w) + 1) | tail -n 1)
else else
#echo Bonjour $USER, nous sommes le `date +"%A %e %B %Y"`, et il est : `date +"%H"` h `date +"%M"` | ponythink #echo Bonjour $USER, nous sommes le `date +"%A %e %B %Y"`, et il est : `date +"%H"` h `date +"%M"` | ponythink
/home/${USER}/bin/bash_quote | ponythink command bash_quote | ponythink
fi
else
printf '%b' "${WHITEB}bonjour function${RESET}: One of the prerequesites is unavailable.\nFor bash_quote please see: https://git.101010.fr/dotfiles-gardouille/scripts/blob/master/bash_quote\n"
fi fi
} }