case in Mac OS X

By: Strauss K Emailed: 1695 times Printed: 2188 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Expand words, and match against patern.

Syntax
      case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac

A case command first expands word, and tries to match it against each pattern in turn, using the same matching rules as for pathname expansion (see Pathname Expansion).

The word is expanded using tilde expansion, parameter and variable expansion, arithmetic substitution, command substitution, process substitution and quote removal.

Each pattern examined is expanded using tilde expansion, parameter and variable expansion, arithmetic substitution, command substitution, and process substitution. If the shell option nocasematch is enabled, the match is performed without regard to the case of alphabetic characters.

When a match is found, the corresponding list is executed. After the first match, no subsequent matches are attempted.

The exit status is zero if no pattern matches. Otherwise, it is the exit status of the last command executed in list.

case is a bash builtin command


macos Home | All macos Tutorials | Latest macos Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

thank you.

View Tutorial          By: lluulnw at 2014-11-22 12:39:35

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Strauss K
cut in Mac OS X
curl in Mac OS X
crontab in Mac OS X
cron in Mac OS X
cp in Mac OS X
continue in Mac OS X
complete in Mac OS X
command in Mac OS X
comm in Mac OS X
cmp in Mac OS X
cksum in Mac OS X
chroot in Mac OS X
chown in Mac OS X
chmod in Mac OS X
chgrp in Mac OS X

More Tutorials in macos
Getting PHP running on Mac OS 10.1
Installing gedit for python programming in Mac OS X
What is Mac OS X?
History of Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
alias, unalias in Mac OS X
apropos in Mac OS X
awk in Mac OS X
basename in Mac OS X
bash in Mac OS X
bg in Mac OS X
bless in Mac OS X
break in Mac OS X

More Latest News
Most Viewed Articles (in macos )
alias, unalias in Mac OS X
case in Mac OS X
Installing gedit for python programming in Mac OS X
What is Mac OS X?
History of Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
apropos in Mac OS X
awk in Mac OS X
basename in Mac OS X
bash in Mac OS X
bg in Mac OS X
bless in Mac OS X
break in Mac OS X
Most Emailed Articles (in macos)
crontab in Mac OS X
What is Mac OS X?
History of Mac OS X
cat in Mac OS X
command in Mac OS X
cp in Mac OS X
Installing gedit for python programming in Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
alias, unalias in Mac OS X
apropos in Mac OS X
awk in Mac OS X
basename in Mac OS X
bash in Mac OS X