Contoh Program Bash Shell Sederhana


Screenshot from 2013-12-09 15:36:05
untuk membuat program dengan tampilan sederhana seperti gambar diatas dengan bahasa pemrograman shell, beriut scriptnya:

#!/bin/sh
ulang=’y’
while [ $ulang = ‘y’ ]
do
clear
echo ” =======================================”
echo “| Program Controller Xampp/Lampp |”
echo “|=======================================|”
echo “| No. MENU |”
echo “|=======================================|”
echo “| 1. Status Xampp/Lampp |”
echo “| 2. Stop Mysql Server |”
echo “| 3. Start Xampp/Lampp |”
echo “| 4. Stop Xampp/Lampp |”
echo “| 5. Keluar |”
echo “|=======================================|”
echo “| Program by: AH. HANDOYO [1412110156] |”
echo “|=======================================”
echo -n “| Masukan No. Menu Pilihan [1-5] : ”
read pilihan

if [ $pilihan -eq “1” ]; then
echo ” ======================================”
echo “| Pesan : Status Xampp/Lampp |”
echo ” ======================================”
sudo /opt/lampp/lampp status
echo ” ======================================”
echo “”;
fi

if [ $pilihan -eq “2” ]; then
sudo /etc/init.d/mysql stop
echo ” ===========================================”
echo “| Pesan : Mysql Server Berhasil Dimatikan |”
echo ” ===========================================”
echo “”;
fi

if [ $pilihan -eq “3” ]; then
sudo /opt/lampp/lampp start
echo ” ===========================================”
echo “| Pesan : Xampp/Lampp berhasil dihidupkan |”
echo ” ===========================================”
echo “”;
fi

if [ $pilihan -eq “4” ]; then
sudo /opt/lampp/lampp stop
echo ” ==========================================”
echo “| Pesan : Xampp/Lampp Berhasil Dimatikan |”
echo ” ==========================================”
echo “”;
fi

if [ $pilihan -eq “5” ]; then
echo ” =================================================”
echo “| Terima Kasih Telah menggunakan Controller ini |”
echo ” =================================================”
echo “”

fi
echo “Ulangi program ini y/t (gunakan huruf kecil) ? ”
read ulang
done

Simpan dengan nama controllampp.sh
dan compile lewat terminal dengan cara ketikan ~$ ./controllampp.sh


9 thoughts on “Contoh Program Bash Shell Sederhana

  1. Two weeks back at tthe same venue a high-intensity 2011 Cricket
    World Cup match was played between India and Pakistan.
    A kid?s world iis such that they would much rather not having homework.
    Her first release was BILLU (2009), directed byy Priyadarshan.

  2. I really cussed at the car, not myself, because I have two dogs that have to be at
    the groomer but are stuck in a car in warm weather.
    There are a range of factors that companies want to modify locks or call for
    locksmith solutions. I use this phrase to calm me down, not just me
    but others as well, when they need simmering. This is because
    only a professional locksmith is equipped with the right tools
    and information to do this job on specific car
    makes and brands. Carolina Used Cars dwell upon the trade-in pricing system.

  3. It is perfect time to make some plans for the longer term and it is
    time to be happy. I have read this submit and if I may just I wish to
    suggest you few interesting issues or suggestions. Maybe you can write
    subsequent articles relating to this article. I wish
    to read even more things about it!

  4. There are several reasons to opt for personal blogs for commercial use.
    I also recently watched the movie of the same name with
    Julia Roberts. Your aim is to identify such companies to sign up with.
    I have fallen countless times and risen up from my own ashes.

    Even with its few drawbacks, Pay – Per – Post
    still comes out on top as the superior paid blogging agent.

  5. We’re a family’owned brand that prides itself on presenting a meal sensation that’s
    rich in Indian culture and flavor, and is all’natural and sensational to experience.
    This is a family thread, but we’re not too uptight. The consequences of
    consuming meaty treats are fatal and life threatening.
    A usual menu found in most of the South Indian Vegetarian Food Restaurant.
    Delhi is fondly called the hub of restaurants because it has hundreds of
    restaurants and eating joints.

  6. I loved as much as you will receive carried out right here.

    The sketch is attractive, your authored material stylish.
    nonetheless, you command get got an nervousness over that you wish be delivering the following.
    unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this hike.

  7. Ping-balik: video camera reviews
  8. naturally such as your web-site however, you really need to check out the punctuation about quite a few of the articles. Many of them are generally filled with transliteration issues and that i believe it is pretty annoying frankly nevertheless I am going to definitely arrive yet again just as before.. The Equalizer HD Download

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s