This commit is contained in:
JMARyA 2023-12-29 01:37:41 +01:00
parent f7e5b8f9f6
commit cc174c7b54
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 52 additions and 38 deletions

View file

@ -1,27 +0,0 @@
---
obj: application
os: linux
repo: https://github.com/Miserlou/Loop
---
# Loop
[Repo](https://github.com/Miserlou/Loop)
Loops in bash are surprisingly complicated and fickle! I wanted a simple and intuitive way to write controllable loops that:
- Run on controllable **timers**!
- `$ loop --every 10s -- ls`
- Have **custom counters**!
- `$ loop --count-by 5 -- 'touch $COUNT.txt'`
- Loop **until output matches** a condition!
- `$ loop --until-contains 200 -- ./get_response_code.sh --site mysite.biz`
- Loop **until a certain time**!
- `$ loop --for-duration 8h -- ./poke_server`
- Loop **until a program succeeds** (or fails!)
- `$ loop --until-success -- ./poke_server`
- Iterate over the **standard input**!
- `$ cat files_to_create.txt | loop -- 'touch $ITEM'`
- Get a **summary** of the runs!
- `$ loop --for-duration 10min --summary -- ls`
- Run until output **changes or stays the same** between invocations!
- `$ loop --until-changes -- date +%s`
- `$ loop --until-same -- date +%s`
- ..and **much more!**