Skip to content

Instantly share code, notes, and snippets.

@troke12
Created May 8, 2016 12:24
Show Gist options
  • Save troke12/fcda1ffa2719a661260f9849283265b4 to your computer and use it in GitHub Desktop.
Save troke12/fcda1ffa2719a661260f9849283265b4 to your computer and use it in GitHub Desktop.
program input pilihan
#!/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