Tuesday, August 30, 2016

Linux Bash Shell Script Switch Case and For Loop Example


Code Switch Case:

Save the code in a file named "SwitchCaseExample.sh".

Running the Code:

Just type the code below in terminal. Make sure to cd into that directory if you have not opened the terminal in that directory.

bash SwitchCaseExample.sh

Code C or, Java Type For Loop:

Save the code in a file named "ForLoopExample.sh".

Running the Code:

Just type the code below in terminal. Make sure to cd into that directory if you have not opened the terminal in that directory.

bash ForLoopExample.sh

No comments: