I have my python function which works perfectly in both windows and linux, when executing the command and processing the output.
def exec_cmd(cmd, fail=True):
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
return output
except subprocess.CalledProcessError as exc:
logging.info(msg)
E.g.:
output = exec_cmd(['accurev', 'stat', '-a'], fail=False)
Now I would need to add "pipe" in order to grep the output within the command immediately.
Command:
accurev stat -a | find "(elink)"
Can you tell me how I can do it? Thanks