Youtuber did this without getting an error message.
#!/bin/bash
if ["$1" == ""]
then
echo "Bad syntax idiot"
else
for ip in `seq 1 254`; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
fi
I get error message.
./pingsweep.sh: line 3: [10.0.2: command not found
It still outputs all the active ips on a subnet but why am i getting this error? Yes, I’m retarded and lazy plz help me anyway.
>Solution :
You need to put a blank after the ‘[‘ and before the ‘]’. Otherwise the intended comparison is not recognized as such.