#!/bin/bash
for ip in 'seq 1 254'; do
ping -c 1 $0.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
the file is ipsweep.sh when i run it show me this
root@kali:ping: ./ipsweep.sh.seq: Name or service unkown
#!/bin/bash
for ip in 'seq 1 254'; do
ping -c 1 $0.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
the file is ipsweep.sh when i run it show me this
root@kali:ping: ./ipsweep.sh.seq: Name or service unkown
First issue:
Replace 'seq 1 254'
with $(seq 1 254)
.
If you replace both '
with backticks it works too, but it's old syntax.
Second issue:
Replace $0
with $1
if you want to provide this part (192.168.1, e.g.) on the command line. $0
contains name of your script.