Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Command is not found

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to put a blank after the ‘[‘ and before the ‘]’. Otherwise the intended comparison is not recognized as such.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading