Hacker News new | past | comments | ask | show | jobs | submit login

I can see it now: a bunch of grizzly old men huddled together in the back room of a local bar, a single bare light-bulb burning above them. Every few seconds they yell in anguish or delight and throw down more cash, words incomprehensible to any outsider. In the middle sits a pasty nerd, slowly typing out `echo $RANDOM` into a computer over and over again.



Now let's not go too far with this hypothetical computer-aided gambling scenario. Everyone knows that Bash keeps a history of commands and that our pasty friend simply needs to press the up arrow followed by return after the first roll of the digital die.


Very true, but never underestimate the importance of theatrics. ;)


Up followed by return is too much work. Let's lighten the load:

    while true; do echo $RANDOM; read -p "Press [ENTER] to continue gambling."; done;
Actually, our pasty friend doesn't really need a job:

    while true; do echo $RANDOM; sleep 10; done;


Attention! carbocation did not type this code. His account was hacked and a programmer working for the internet mafia released this code using his stolen account to make him the unwitting fall guy.

carbolocation was with me all afternoon, we were at church working in the soup kitchen, feeding the poor. We did so anonymously because we believe people who take credit for charity work are ego-maniacal monsters.


    watch -n 10 'echo $RANDOM'


  while echo $RANDOM; do sleep 10; done




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: