In a shell script, if you want a loop to execute infinitely, which of the following would be the most appropriate construct?

  • while true; do
  • for (( ; ; )); do
  • until false; do
  • do forever;
The most appropriate construct for an infinite loop in a shell script is while true; do. This creates a loop that continues to execute as long as the condition true remains true, effectively resulting in an infinite loop.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *