diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-12-25 16:02:57 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-12-25 16:03:03 +0800 |
| commit | 212f89270bee3367af3810d8e974ca1ea010b692 (patch) | |
| tree | c8b8bca79f1ce0db60b60609f67c0e2b44e8bcad | |
| parent | e940ab3a8b2c0a9109ed0e36f4afad784eef846c (diff) | |
Update
| -rw-r--r-- | snippets/bash_limited_job_for_loop_and_cpu | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/snippets/bash_limited_job_for_loop_and_cpu b/snippets/bash_limited_job_for_loop_and_cpu new file mode 100644 index 0000000..4aa64a0 --- /dev/null +++ b/snippets/bash_limited_job_for_loop_and_cpu | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | while [ $(jobs -p | wc -l) -ge 10 ]; do | ||
| 2 | sleep 0.5; | ||
| 3 | done | ||