티스토리 뷰

728x90
import subprocess
output = subprocess.check_output("cat syscall_list.txt | grep f89e7000 | awk '{print $2}'", shell=True)

https://stackoverflow.com/questions/8659275/how-to-store-the-result-of-an-executed-shell-command-in-a-variable-in-python

 

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

'공부' 카테고리의 다른 글

[sh] bash: /bin/find: Argument list too long  (0) 2023.07.29
[python] decimal.Decimal('0.1') * 3 == decimal.Decimal('0.3')  (0) 2023.07.29
[python] sock retry  (0) 2023.07.29
[sh] curl get `content-length`  (0) 2023.07.29
[python] safe_divide  (0) 2023.07.29
댓글