Skip to content

Instantly share code, notes, and snippets.

@blackzphoenix
Last active March 27, 2019 23:55
Show Gist options
  • Select an option

  • Save blackzphoenix/3e79c87d582bcd63d83414ee8bc3f326 to your computer and use it in GitHub Desktop.

Select an option

Save blackzphoenix/3e79c87d582bcd63d83414ee8bc3f326 to your computer and use it in GitHub Desktop.
case programs
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