Python Forum
Grep command and variable in a script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grep command and variable in a script
#2
set addr equal to the ip you want to grep:

import subprocess

cmd = "grep " + addr

returned_value = subprocess.check_output(cmd)

print('returned value:', returned_value)
Reply


Messages In This Thread
RE: Grep command and variable in a script - by marienbad - Feb-21-2019, 05:22 PM

Forum Jump:

User Panel Messages

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