Using a for loop to list favorite fruits
📖 Scenario: You want to tell your friends about your favorite fruits by listing them one by one.
🎯 Goal: Write a bash script that uses a for loop to go through a list of fruits and print each fruit on its own line.
📋 What You'll Learn
Create a list of fruits in a variable called
fruitsUse a
for loop to go through each fruit in fruitsPrint each fruit inside the loop
💡 Why This Matters
🌍 Real World
Listing items and processing them one by one is common in scripts that manage files, users, or tasks.
💼 Career
Knowing how to use for loops in bash helps automate repetitive tasks in system administration and DevOps roles.
Progress0 / 4 steps