[help] kok error else dalam bash script
#4
(06-13-2012, 01:35 AM)Udalah Wrote: ane coba bantu ni om, sorry klu salah ya, baru megang bactrack 2 bulan, n ane baru liat bash script ini yg prtama

jadi kn scriptnya gini

(05-06-2012, 11:19 AM)junior.riau18 Wrote: if ["$fp"=="n"]
for i in {1..10}
do
{
iptest=$ip$i
ping -c 1 $iptest > /dev/null
[ $? -eq 0 ] && echo Host with IP: $iptest is live.
}
done

trus ane rubah jadi gini
Code:
if ["$fp"=="n"];
then
for i in {1..10}
do
{
iptest=$ip$i
ping -c 1 $iptest > /dev/null
[ $? -eq 0 ] && echo Host with IP: $iptest is live.
}
done

jadi, setelah statement if, itu musti ditutup make ";" biar ga tembus, terus di tambahin then

ni ssnya

[Image: 6y1w6x.png]

tapi skrng muncul error gini

./ipchecker.sh: line 21: [y==n]: command not found

ane ga tau lagi gmn, smoga membantu Smile

thanks udah bantu yak
nanti ane revisi lagi tools nya ^_^


Messages In This Thread
RE: [help] kok error else dalam bash script - by Junior Riau - 06-13-2012, 05:26 AM




Users browsing this thread: 1 Guest(s)