I'm looking to improve it in brevity, readability, and simplicity. Basically, I'm just looking for a more elegant solution. What improvements can I make?i=0while true; do    OUTPUT=$(docker inspect --format='{{json .State.Health.Status}}' su-apache)    if [ $OUTPUT = 'healthy' ]; then      echo      break    fi    echo -en \r\033[KWaiting $i seconds for su-apache to finish starting... Current health: $OUTPUT    let i++    sleep 1doneecho 'Environment started successfully.'
Pausing script while waiting for Docker container and printing updates
console;linux;shell;status monitoring
If you don't mind using Bash,then it will be more elegant to replace the while loop with a counting for loop:for ((i = 0; ; i++)); do    # ...doneI'm guessing that you're using Bash anyway from the let i++ syntax,which will not work with simpler shells like Dash.Note that the various flags of echo are not portable.For a more portable solution, replace it with printf.Lastly, the indentation is inconsistent: some blocks are indented with 4 spaces, others with 2. It would be better to indent consistently (I like 4 spaces).