#!/bin/bash echo -e "\033[31mProgram IP converter v4 to Biner -- Tugas Jaringan Komputer\n\033[0m" echo -e "\033[34mPowered By : Ahmad Afis, Heru SP, Nur Hayati\n\033[0m" echo -e "\033[33mMasukkan IP address, tiap range di pisahkan oleh spasi\033[0m" echo -e "\033[33mExample : IP adress 192.168.200.100 so 192 168 200 100\033[33m\n"
echo -n -e "\033[32mMasukkan IP adress :\033[0m" read data1 data2 data3 data4
part1=`echo "obase=2;$data1" | bc` part2=`echo "obase=2;$data2" | bc` part3=`echo "obase=2;$data3" | bc` part4=`echo "obase=2;$data4" | bc` echo -e "\nSource IP \033[1;31m$data1.$data2.$data3.$data4 \033[0m" echo -e "Result \t \033[1;32m$part1.$part2.$part3.$part4\033[0m\n" echo -e "\033[34mreferensi\nhttp://www.basicallytech.com/, command-line-calculations-usingbc\033[0m"