Monday 14 December 2015

Creating a Restaurant Menu using Shell script

I love to visit restaurant and on their counter you will see a machine, having list of all the items with their price tags. With the help of that machine, they generate your bills. You can create a same using the shell script.

Here is the code:

#!/bin/bash
out=$(dialog --stdout --menu 'CodingTheRightWay Menu' 999 999 999 Chocolate \$5 IceCream \$10)
echo "You ordered chocolate $out"

Save the code, and make it executable.

Once you run the code, then it will look like this:



You can use your keyboard arrows to choose the item, and for placing order. Cool!

Now, it's your time to create something interesting out of it.

Cheers,