I have a shell script abc.sh which is called from a Python script custom_package.py using subprocess.call function call. I want to return a value from abc.sh and read it in Python.
Python call to shell script is as follows.
subprocess.call(['abc.sh', user, password])
abc.sh echos "running" or "not running". How can I capture "running" or "not running" in the Python script? Something like:
ret_val = subprocess.call(['abc.sh', user, password])
I have tried subprocess.check_output but it's not working.
ret_val = subprocess.check_output(['abc.sh', user, password])