Sleep after the second loop in a shell script

2023-07-20 20:48 (1 years ago) ytyng

Here's the translation of the provided Japanese blog article into English:


When processing redundant items one by one, you may need to sleep after the second loop to avoid doing everything at once.

#!/usr/bin/env zsh

sleep_command=""
for i in {1..3} ; do
    eval ${sleep_command}
    echo ${i}
    sleep_command="sleep 10"
done

Current rating: 5
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011