2013-11-26 3 views

ответ

0

Добавьте к этому .bash_profile:

touch .daily_login_count 
read tomorrow count < .daily_login_count # It's OK if file is empty 
# Check if this is the first login of the day 
if (($(date +%s) > tomorrow)); then 
    count=0 
    ((tomorrow += 86400)) 
fi 
((count++)) 
echo "$tomorrow $count" > .daily_login_count 
echo "$(date) $user $count login(s) today" 
Смежные вопросы