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.
Loading...
Related Quiz
- For an SSH server, the main configuration file is found at /etc/ssh/________.
- During the Linux boot process, which script initializes the system settings?
- Docker primarily deals with which kind of virtualization?
- Which option with the ssh command specifies a different port for connection?
- When a script is not behaving as expected, you can add the _________ option at the top of the script to display each command before it's executed.