From 91b78638727414a8ffa4aa5a3244433c8b65547b Mon Sep 17 00:00:00 2001 From: Aryan Singh Date: Sat, 12 Sep 2026 20:54:41 -0500 Subject: [PATCH] Update client.py --- MP1/client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MP1/client.py b/MP1/client.py index 579bf7b..20a2906 100644 --- a/MP1/client.py +++ b/MP1/client.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import socket +import sys PORT = 5055 ALL_IPS = [ @@ -46,7 +47,6 @@ def grep_all_ips(ips, cmd): try: client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((ip, PORT)) - # print(f"Connected to server at {ip}:{PORT}") full_cmd = cmd + f" ./machine.{i + 1}.log" @@ -68,9 +68,7 @@ def grep_all_ips(ips, cmd): return match_count -#get all the argument of call -import sys - +#main cmd = "grep " + " ".join(sys.argv[1:]) match_count = grep_all_ips(ALL_IPS, cmd)