Name: Anonymous 2009-08-18 18:48
soup /prog/?
I'm trying to lern bash but i fucking suck, can anyone tell me what the fuck is wrong with this script?
inb4 n00b, linux sucks, ect.
also is there a simple bash one liner to determine dhcp hostnames?
(first post in the text boards btw, bbcode works here right?)
I'm trying to lern bash but i fucking suck, can anyone tell me what the fuck is wrong with this script?
inb4 n00b, linux sucks, ect.
#!/bin/bash
TMPFILE="/tmp/$$"
trap "{ rm -f $TMPFILE; exit 255; }" SIGINT SIGTERM EXIT
touch $TMPFILE
for ((i=100;i<116;i++)); do
{ ping -c1 192.168.1.$i 1>/dev/null & }
if [ "$?" == "0" ];then
echo "[1;31m ■ [0m 192.168.1.$i" >> $TMPFILE
else
echo "[0;32m ■ [0m 192.168.1.$i" >> $TMPFILE
fi
done
sleep 2
clear
cat $TMPFILE
exit 0also is there a simple bash one liner to determine dhcp hostnames?
(first post in the text boards btw, bbcode works here right?)