Hello everyone!
just dumped bytes forums and joined daniweb... hope its a good decision :P
anyway, could you guys take a second to look at the following code...
import subprocess as sp
cmd = "awk '{print $0}'"
ex = sp.Popen(cmd.split(' '), stdin = sp.PIPE, stdout = sp.PIPE, stderr = sp.PIPE)
ot, et = ex.communicate('''abc
def
ghi
jkl
mno''')
print ot
if et:
print 'ERROR:'
print et
So, if you have the least knowledge of awk, you can tell that all the piped input is supposed to be printed as output.
but what i instead get is this:
ERROR:
awk: 1: unexpected character '''
awk: line 2: missing } near end of file
what is that supposed to mean.. please help... any response is fine :)
thank you