I am running a script which internally calls a bash command and parses the output accordingly. For example i am calling this command
result = subprocess.check_output("rg result",shell=True)
print(output)
I get this output without any line number or anything
historyChecker.py: result = subprocess.check_output("rg --help",shell=True)
historyChecker.py: output = re.search(r'USAGE:',result)
If i run the same command in bash i get a different result
[~/history_checker/code]$ rg result
historyChecker.py
56: result = subprocess.check_output("rg --help",shell=True)
57: output = re.search(r'USAGE:',result)
any idea why this is happening and how we can solve this. Thanks