You're creating a script that should take different actions based on the day of the week. Which Bash construct would be most suitable for this?

  • if...else statements
  • case statement
  • for loop
  • while loop
The most suitable Bash construct for taking different actions based on the day of the week is the case statement. You can use case to evaluate the value of the day and define different actions for each day. Options 1, 3, and 4 are not specifically designed for this purpose; they serve different scripting needs.
Add your answer
Loading...

Leave a comment

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