Published on March 21, 2017 by ProgrammingKnowledge

For more detailed Tutorial visit – goo.gl/jLzKh2

The case statement is used to execute statements based on specific values. Often used in place of an if statement, if there are a large number of conditions.The variable is compared with the values using the shell wildcards ( ? * […] ) , NOT regular expressions. All the statements are executed for the first matching value until the ending ;;. If no value matches, then the default *) case is executed, if present.
case statement:
Specify number of possible values for variable
Statement block executed for matching value
Only one block executed

My Website – www.codebind.com
My Blog – goo.gl/Nd2pFn
My Facebook Page – goo.gl/eLp2cQ
Google+ – goo.gl/lvC5FX
Twitter – twitter.com/ProgrammingKnow
Pinterest – goo.gl/kCInUp
Text Case Converter – goo.gl/pVpcwL
Epoch Timestamp Converter – goo.gl/Zedjo5
Decimal – Binary – Hexadecimal Converter – goo.gl/rkX3JE
8-bit Checksum Calculator – goo.gl/inxvIT

Leave a Reply

4 Comments on "Shell Scripting Tutorial for Beginners 12 – The case statement"

Notify of
avatar

manojkumar kavuluri
Guest
manojkumar kavuluri
8 months 11 days ago

can u please explain in detail why did you declare the vehicle as $1

Exodus
Guest
Exodus
10 months 28 days ago

+Programmingknowledge Hello I just wanted to ask you how a Linux Terminal or a CMD is programmed or made? And can you do a video on it please?

upgrade to NINTENDO
Guest
upgrade to NINTENDO
10 months 29 days ago

THE VIDEO TUTORIAL IS REALLY VERY USEFUL for BIGINERS

ProgrammingKnowledge
Guest
ProgrammingKnowledge
10 months 29 days ago

For more detailed Tutorial visit – goo.gl/jLzKh2

wpDiscuz