I have the following bash script, which is supposed to spider a range of IP addresses.
#!/bin/bash
a = 0
for i in `seq 1 255`;
do
a = a + 1
echo $i
wget -r --spider -D --header="Accept: text/html" --user-agent="Order Of The Mouse: Stress Tester" 139.162.246.$a:80
done
However, at the moment it doesn't include the variable a
. How do I properly include a variable in a command line argument when writing a bash script?
Current output looking like this:
/root/burningWood/scripts/StressTest/tester.sh: line 5: a: command not found
254
Spider mode enabled. Check if remote file exists.
--2016-08-28 13:23:10-- http://139.162.246./
Resolving 139.162.246. (139.162.246.)... failed: Name or service not known.
wget: unable to resolve host address ‘139.162.246.’
Found no broken links.