KANG BAYU

Beranda » Info Sekolah » Kuliah » Sistem Operasi » Tugas Kuliah SO

Tugas Kuliah SO

#!/bin/bash

#Declare variable choice and assign value4
choice=4
#print to stdout
echo”1.Bash”
echo”2.Scripting”
echo”3.Tutorial”
echo-n”silahkan pilih kata [1,2or3]?”
#loop while the variable choice is equal 4
#bash while loop
while[$choice-eq4];do

#read user input
read choice
#bash nested if/else
if[$choice-eq1];then

echo”You have chosen word:Bash”
else
if[$choice-eq2];then
echo”You have chosen word:scripting”
else
if[$choice-eq3];then
echo”You have chosen word:Tutorial”
else
echo”Please make a choice between 1-3!”
echo”1.bash”
echo”2.scipting”
echo”3.tutorial”
echo-n”silahkan pilih kata [1,2or3]?”
choice=4
fi
fi
fi
done


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

The Big DayMaret 5th, 2012
The big day is here.
%d blogger menyukai ini: