Shell Scripting

Baru sempat mencoba shell scripting lagi [ setelah saya tinggalkan kurang lebih 3th yang lalu ].

#!/bin/bash
clear
echo “MENU HARI INI”;
echo “————–”;
echo “1. Bakso “;
echo “2. Gado-Gado “;
echo “3. Exit “;
read -p “Pilihan anda [1-3]:” pil;

if [ $pil -eq 1 ];
then
echo “Banyak mangkuk=”;
read jum
let bayar=jum*1500;
elif [ $pil -eq 2 ];
then
echo “Banyak porsi=”;
read jum
let bayar=jum*2000;
elif [ $pil -eq 3 ];
then
exit 0
else
echo “Sorry, tidak tersedia”
exit 1
fi

echo “Harga bayar=Rp.$bayar”
echo “Terima Kasih”

 

*) Tidak ada penjelasan untuk hary ini, yuk ahh mencoba lagi 😀

Advertisements

Tinggalkan pesan atau komentar

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s