A. Case allows using Extended regular expressions in comparisons whereas if conditionals can only use file globs.
B. Case executes conditions based on the return code of commands. An if conditional can only check values of variables and comparisons.
C. Case has no advantage over if conditionals.
D. If checking a condition against multiple values a case statement can be more efficient as it does the comparison one time. With if conditionals you may need an if conditional with successive elifs to accomplish the same goal.
No comments:
Post a Comment