#!/bin/bash
NOMBRE=`cat /etc/passwd | grep "^$LOGNAME" | \
cut -d: -f5 | cut -d' ' -f1`
HORA=`date | cut -c12-13 | tr -d ' '`
tiempo=`date +%H:%M`
dia=`date +%d-%m-%Y`
if expr "$HORA" \<= 5 > /dev/null
then
echo 'Buenas noches, '$NOMBRE | espeak -v spanish -s 150
sleep=1
echo 'Son las, '$tiempo', horas ' ' del '$dia', ya puedes comenzar a usar tu P C, cambio y fuera' | espeak -v spanish -s 140
elif expr "$HORA" \<= 12 > /dev/null
then
echo 'Buenos dias, '$NOMBRE | espeak -v spanish -s 150
sleep=1
echo 'Son las, '$tiempo', horas ' ' del '$dia', ya puedes comenzar a usar tu P C, cambio y fuera' | espeak -v spanish -s 140
elif expr "$HORA" \<= 19 > /dev/null
then
echo 'Buenas tardes, '$NOMBRE | espeak -v spanish -s 150
sleep=1
echo 'Son las, '$tiempo', horas ' ' del '$dia', ya puedes comenzar a usar tu P C, cambio y fuera' | espeak -v spanish -s 140
elif expr "$HORA" \<= 24 > /dev/null
then
echo 'Buenas noches, '$NOMBRE | espeak -v spanish -s 150
sleep=1
echo 'Son las, '$tiempo', horas ' ' del '$dia', ya puedes comenzar a usar tu P C, cambio y fuera' | espeak -v spanish -s 140
fi