Here is an alias I made on my ~/.bashrc:
alias rand="echo $(curl -s https://whatthecommit.com/index.txt)"
If you enter this url, it simply returns a random message every request, as intended.
But if you use this alias from command line:
rand
it'll always returns the same message, instead of making a new http request, as if it's caching the previous result for some reason.
BUT, if you call it directly on terminal as:
echo $(curl -s https://whatthecommit.com/index.txt)
It makes a different call every time.
Why is this happening? And how to fix it?
 
    