Python Forum
I don't understand the parameters in a statement that uses the sh library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I don't understand the parameters in a statement that uses the sh library
#1
I'm putting together a hacking program for a school project. I found the following ping sweep script on youtube:
#PingSweep.py
#This program will find all of the active ip addresses in a network
import ipaddress
import sh

print("Enter a network address with a slash number.")
chooseNetworkAddress = input("")
network = ipaddress.ip_network(unicode(chooseNetworkAddress))

for i in network.hosts():
    try:
        sh.ping(i, "-c l")
        print(i, " is active")
    except sh.ErrorReturncode_l:
        print(" no response from", i)
But I don't understand the "-c l" parameters used on line 12. Does anybody know what those are supposed to do?
Reply
#2
It is probably ping -c 1. This causes ping to stop after 1 request, according to the ping command's manual.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysql. Not all parameters were used in the SQL statement cybertooth 5 18,844 Oct-14-2021, 05:01 AM
Last Post: cybertooth
  .Set - Unable to understand the statement ateestructural 5 2,393 Aug-02-2020, 08:24 PM
Last Post: deanhystad
  Unable to understand a statement in an existing code ateestructural 1 2,238 Aug-01-2020, 09:38 PM
Last Post: deanhystad
  I don't understand this return statement 357mag 4 2,776 Jul-10-2019, 07:02 PM
Last Post: perfringo
  MySQL Insert Not all parameters were used in the SQL statement rfgallon 3 21,343 Nov-14-2018, 07:59 PM
Last Post: buran
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,817 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020