공부
[python] shell script -> result -> variable
승가비
2023. 7. 29. 06:28
728x90
import subprocess
output = subprocess.check_output("cat syscall_list.txt | grep f89e7000 | awk '{print $2}'", shell=True)
How to store the result of an executed shell command in a variable in python?
I need to store the result of a shell command that I executed in a variable, but I couldn't get it working. I tried like: import os call = os.system("cat syscall_list.txt | grep f89e7000 | aw...
stackoverflow.com
728x90