Use bash instead of sh as the shell of choice for python command namespace functions -
i need use commandline suited bash style, e.g.
diff x <(cat y | tail +2)
however, sh -c of above line gives error, hence commands.getoutput of above line fails. however, bash -c of above want done. can suggest how make python use bash. understand can done using subprocess, have lot of command lines have process , want use commands.getoutput.
thanks.
you can commands.getoutput("bash -c 'diff x <(tail +2 y)'")
, perhaps (note cat
unnecessary).
however: commands.getoutput('tail +2 y | diff x -')
doesn't require bash.
Comments
Post a Comment