Day 47 of My Cloud Computing Journey
Today, I continued learning about Loop in bash scripting, with focus on
Until Loop
Select Loop.
What I learned (Key Lessons)
Until Loop
- This executes a block of code until a specified condition becomes true.
- The loop runs when condition is false and stops when the condition evaluates to true.
syntax:
until [ condition ]
do
command
done
Select Loop
- The select loop is used to create interactive menu-based interfaces in bash scripting.
- It displays a numbered list of options to the user who select an option by entering its number.
- The select loop automatically stores the user's choice in a variable known as REPLY, which contains the number entered.
- It is often combined with "case statement."
syntax:
select variable in list
do
command
done
PRACTICAL VIDEO
The video below demonstrates how loop, until loop and select loop are used in bash scripting.
#CloudComputing #Cloudengineer #BashScripting #loop #SelectLoop #UntilLoop #TechUpdate