Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I come across quips and insights that I want to remind myself of; including them in a random message of the day as a ZSH login message is the right amount of "flair" for me. But this is too noisy if it's a new random choice each time I open a shell. Using today's date as a source of randomness gives us a random choice that's the same all day long. So this is in my .zshrc:

    motd() {
        date +%D > /tmp/motd_seed
        sort -R --random-source=/tmp/motd_seed ~/Dropbox/motd.txt | head -n 1
    } 

    motd
```


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: