Last active
March 27, 2019 23:55
-
-
Save blackzphoenix/3e79c87d582bcd63d83414ee8bc3f326 to your computer and use it in GitHub Desktop.
case programs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file 1: prog.sh | |
| #!/bin/bash | |
| var=$1 | |
| case $var in | |
| maths) | |
| echo "In Engineering we have MATHS in 1st to 4th Sem..." | |
| ;; | |
| phy) | |
| echo "Luckily or Sadly we have we have PHYSICS only for 1st or 2nd Sem..." | |
| ;; | |
| ece|cse|ise|ae|ipe|ce|eee) | |
| echo "Now its time to ask Seniors..." | |
| ;; | |
| *) | |
| echo "PSECE" | |
| echo "Welcome to $var Department !!!" | |
| echo "Have a nice time !!" | |
| echo " $var : Departmental Issues!! talk to HOD" ;; | |
| esac | |
| file2 : execute.sh | |
| chmod +x prog.sh | |
| ./prog.sh maths | |
| ./prog.sh phy | |
| ./prog.sh ec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment