Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ping error? Invalid Argument

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    5 Posts 3 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gabriel 3
      last edited by

      Hello .. Good evening! I created a command, but it is giving "

      ping: invalid argument: '192.168.0.1'

      I built this code:
      #!/bin/bash

      for ip in $(seq 1 20); of

      ping -c $1.$ip | grep "64 bytes" | cut -d " " -f 4

      done

      Can someone help me?

      1 Reply Last reply Reply Quote 0
      • johnpozJ johnpoz moved this topic from Wireless on
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Where are you trying to run it?

        G 1 Reply Last reply Reply Quote 0
        • G
          Gabriel 3 @stephenw10
          last edited by

          @stephenw10 Kali Linux! 2022

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Looks like it's trying to use the IP address as the ping count. Like:

            steve@steve-NUC9i9QNX:~$ ping -c 192.168.0.1
            ping: invalid argument: '192.168.0.1'
            
            1 Reply Last reply Reply Quote 0
            • T
              touchstone404
              last edited by

              Better late than never.........

              I had a similar issue and noticed that you didn't have a number '1' after -c (presuming that you only wanted it to ping once): -c 1

              Maybe that would work.

              Cheers.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.