Let's start our activity as follows:
- Open a terminal and create the recursive_read_input.sh script:
#!/bin/bashfunction recursive_func() { echo -n "Press anything to continue loop " read input recursive_func}recursive_funcexit 0
- Execute the $ bash recursive_read_input.sh script—press Enter at the prompt and wait for another prompt.
- Exit the program with Ctrl + C.
- Open a terminal and create the loop_for_input.sh script:
#!/bin/bashfor (( ; ; )) do echo "Shall run for ever" sleep 1 doneexit 0
- Execute the $ bash loop_for_input.sh script—press Enter at the prompt and wait for another prompt.
- Exit the program with Ctrl + C.
- Open a terminal and create the loop_while_input.sh script:
#!/bin/bashEXIT_PLEASE=0while : # Notice ...