Created
May 8, 2016 12:24
-
-
Save troke12/fcda1ffa2719a661260f9849283265b4 to your computer and use it in GitHub Desktop.
program input pilihan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#belajar3y | |
echo -n "Masukan nama kamu :" | |
read nama; | |
echo "Daftar Pilihan"; | |
echo "--------------"; | |
echo "1. Anjing "; | |
echo "2. Kucing "; | |
echo "3. Ayam "; | |
read -p "Pilihan Anda [1-3] :" pil; | |
if [ $pil -eq 1 ]; | |
then | |
echo "$nama memilih Anjing"; | |
fi | |
if [ $pil -eq 2 ]; | |
then | |
echo "$nama memilih Kucing"; | |
fi | |
if [ $pil -eq 3 ]; | |
then | |
echo "$nama memilih Ayam"; | |
fi | |
echo $nama memilih nomor $pil >> /home/troke/hasil.txt | |
#untuk melihat hasil file yg sudah diinput | |
#cat /home/troke/hasil.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment