I am new to shell scripting. I have Ubuntu 9.04 and i am using it since a few weeks. I am learning shell scripts and need help with using Bash case statement help on Ubuntu linux. Can anyone help me with an example? Thanks!
I am new to shell scripting. I have Ubuntu 9.04 and i am using it since a few weeks. I am learning shell scripts and need help with using Bash case statement help on Ubuntu linux. Can anyone help me with an example? Thanks!
The case statement is very smart replacement for if/then/else if/else statements when making comparisons in a large numbers. This command makes it easy for the user and script developer to create number of cases [choice] and edit it and make changes to the script without making too much changes. This works with all the shells, like bash, ssh, etc...
Thanks for the reply... But can anyone give me its syntax or an example so that i can understand it and implement it myself, so i could learn it quickly... Thanks in advance...
Syntax of Case Statement :
All the best and happy coding...Code:case "$var" in value1) commands; ;; value2) commands; ;; *) commands; ;; esac
Bookmarks