shell script capture command output in a variable code example
Example 1: how to execute bash commands in python script
import subprocess
subprocess.call(["sudo", "apt", "update"])
Example 2: shell script to check the output of a file
-s file path