I am trying to execute the following command line via Python.
Cat File |grepcidr -f file.name >>output.file
if I use subprocess.call
subprocess.call(["cat", "File", "|", "grepcidr -f", "file.name", ">>output.file"])
It just tries to Cat everything.
Any help would be appreciated.
Trivial but non-portable way:
It requires
/bin/sh, which should not be a problem if you rely oncatanyway. I think it’s possible to build a family of cooperating subprocesses yourself: you’d have to do what/bin/shdoes with pipes and redirections, but in python.