-2
    #!/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

Cyrus
  • 84,225
  • 14
  • 89
  • 153
R3d_F1lc0n
  • 21
  • 4

1 Answers1

1

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.

Cyrus
  • 84,225
  • 14
  • 89
  • 153