I am trying to write a bash ping sweeper and I get two error messages.
The first is:
./pingsweep.sh: line 2: [192.168.199.182: command not found
The second is
ping: 192.168.199.182.seq: Name or service not known.
I cant spot the error from the initial code:
#!/bin/bash
if ["$1" == ""]
then
echo "Usages:./pingsweep.sh [network]"
echo "Example: ./pingsweep.sh 192.168.199"
else
for ip in 'seq 1 254'; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | sed 's/.$//'&
done
fi