logoalt Hacker News

mandustoday at 3:29 PM2 repliesview on HN

One of the things I do with : is infinite while-loops, like:

    while :; do
        <do stuff>
        sleep n
    done

Maybe to mainstream to make the cut!?

Replies

ndsipa_pomutoday at 3:42 PM

I prefer using "while true;" as that's easier to read. Arguably, it's less efficient due to calling the external "true".

Strangely though, I much prefer using the builtin "printf" to replace "echo" and "date", though the "date" usage is harder to read.