On 06/06/12 20:33, dohoang4...@comcast.net wrote:
i am writing a python script that will be invoked as follows:
cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE,
stderr=STDOUT)
Assuming you really want to use egrep, why?
You could process the file directly in Python sea
Please respond back to the list (so others know what worked
and that the problem is solved).
:)
>
> hi all,
>
> thanks a lot for your quick response.
>
> Dave, actually it's a 2 arguments. Sorry, i did not make it clear in my
> question. I used Ramit's hint and it worked. The code should
> > x = "Device " + sys.argv[1] + " restored the database"
> > y = "Created connection to " + sys.argv[1]
> >
> > cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE,
> > stderr=STDOUT)
> >
> > the above code does not work because it will look for x and y in aLogFile
> x = "Device " + sys.argv[1] + " restored the database"
> y = "Created connection to " + sys.argv[1]
>
> cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE,
> stderr=STDOUT)
>
> the above code does not work because it will look for x and y in aLogFile
> instead of
On 06/06/2012 03:33 PM, dohoang4...@comcast.net wrote:
> i am writing a python script that will be invoked as follows:
>
> myScript.py
>
> and the script is as follwos:
>
> x = "Device " + sys.argv[1] + " restored the database"
> y = "Created connection to " + sys.argv[1]
>
> cmd_line = Popen
i am writing a python script that will be invoked as follows:
myScript.py
and the script is as follwos:
x = "Device " + sys.argv[1] + " restored the database"
y = "Created connection to " + sys.argv[1]
cmd_line = Popen(["egrep", "(x,y)", aLogFile], stdout=PIPE, stdin=PIPE,
stderr=STDOUT)