INFO KNOWLEDGE

Bash Shell – Contoh Program


Berikut Contoh sederhana Pemrograman Shell

#!/bin/sh    mengaturIP(){
echo “Daftar IP Adress”
sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0    ifconfig
}

dAktif(){
echo “Berikut Daftar List Direktori yang Sedang Aktif”
sudo ls -l
}
ulang=’y’
while [ $ulang = ‘y’ ]
do
echo “1. Melihat IP Adress”
echo “2. Melihat direktori aktif”
echo “masukkan pilihan Anda : “;
read pil
case $pil in
1)mengaturIP;;
2)dAktif;;
*) echo “pilihan Anda salah”
esac
echo “Ulangi program ini y/t (gunakan huruf kecil) ? ”
read ulang
done


Cara Compile:
./nama_file.sh
atau
. nama_file.sh

2 responses to “Bash Shell – Contoh Program”

  1. ¿Que tal? ¿Te importaria informarme que el webhost que estas
    utilizando? He cargado tu blog en 3 navegadores radicalmente desiguales y noo puedo añadir otra cosa
    que este weblog se carga con velocidad en el conjunto de ellos.
    ¿Puedes sugerir un buen suministrador de compañia de hostingg a
    un precio justo? Gracias!

  2. Thankfulness to my father who shared with me concerning this webpage, this blog is truly awesome.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.