News for hackers. Stuff that matters.
Re:Show HN: `loop`, Unix's missing loop commmand by Mizza on Wednesday June 27, 2018 @09:33AM (#17407949)
I have always found writing loops in Bash to be fickle, tedious, and needlessly complicated.

`loop` allows you to write intuitive, powerful looping one liners, with many useful features like breaking on pattern matching, timed loops, and loops for a specific duration.

For instance, to try a thing until it succeeds, every 15 seconds, for a maximum of five times in Bash:

    n=0
    until [ $n -ge 5 ]
    do
       do_thing.sh && break
       n=$[$n+1]
       sleep 15
    done
becomes:

    loop './do_thing.sh' --every 15s --until-success --num 5    
This was also my first Rust project, so feedback is welcome!
Re:Show HN: `loop`, Unix's missing loop commmand by Schumer on Wednesday June 27, 2018 @01:03PM (#17409848)
Very useful but nothing UNIX about it