تقييمات الطلاب
( 5 من 5 )
١ تقييمات
فيديو شرح Master Linux Shell Scripting: Learn Case statement ضمن كورس Bash Scripting شرح قناة Infinite Linux، الفديو رقم 14 مجانى معتمد اونلاين
A case statement is a way to control the flow of a shell script by allowing you to specify multiple branches of code to be executed based on a single variable. It is similar to the switch statement in other programming languages.
case variable in
pattern1)
commands1;;
pattern2)
commands2;;
.
esac
The variable is the value that the case statement will use to determine which branch of code to execute. The pattern1, pattern2, etc. are the different values that the variable can take on, and the corresponding commands1, commands2, etc. are the commands that will be executed if the variable matches the corresponding pattern.