I am trying to run this command git status -vv | awk 'NR>5 {print $0}' from within a Python file. But I cannot get the awk command working.
Here is a sample result of my git st:
# On branch master
# Your branch is ahead of master by 2 commits.
#
#
# modified: file1
# modified: file2
# modified: file3
When I run the command from the terminal, I get what I want:
# modified: file1
# modified: file2
# modified: file3
I am having trouble implementing it from within a Python script:
import sys
import subprocess as sb
ps = sb.Popen(("git","status","-vv"),stdout=sb.PIPE)
output = sb.check_output(('awk','"NR>5 {print $0}"'),stdin=ps.stdout)
print output
However, this returns just the git st results without the awk performed on the lines. How can I do this from within python to get the same output as I do when running in the terminal.