Shell Program for Student Data Input (SPStDI)



AVAILABLE:    5

This is a historical remnant from studying Linux back in college, around the second semester. Basic logic programming always starts with simple case studies and uses a straightforward environment—what else if not the command line? Everything was about the command line, terminal, and similar tools.

Program:

#!/bin/sh
#12131294.sh
#Student Biodata
#date: 10/05/14

for i in $(ls); do
echo "--------------------------"
echo "--------------------------"
echo "1. Input Data"
echo "2. Display Data"
echo "3. Exit"
echo -n "Choice: "
read PILIH
case $PILIH in
1)
echo -n "Name: "
read nama
echo -n "NIM (Student ID): "
read nim
echo -n "Class: "
read kelas
echo -n "Study Program: "
read prodi
echo -n "Campus: "
read kampus
echo -n "Campus Address: "
read alamat
;;
2)
echo
echo "Name: $nama"
echo "NIM: $nim"
echo "Class: $kelas"
echo "Study Program: $prodi"
echo "Campus: $kampus"
echo "Campus Address: $alamat"
;;
3)
exit
;;
*)
echo "Sorry, the option you selected is not available!"
;;
esac
done


Output:

Hopefully, this is helpful and happy learning!


Post a Comment

Previous Next

نموذج الاتصال