Solution for the function in shell

i used "case" functionality to reduce the number of line. if it not proposable let me know i'll give a solution using "if"
Merge pull request #83 from itzdarsh/patch-1

Solution for the function in shell