
Show HN: `loop`, Unix's missing loop commmand - Mizza
https://github.com/Miserlou/Loop
======
Mizza
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!

------
Schumer
Very useful but nothing UNIX about it

