I can't figure out why my code doesn't return any output. I'm running python 3.8
bash_command = ['compgen', '-c']
process = subprocess.run(bash_command,
check=True,
text=True,
shell=True,
executable='/bin/bash',
capture_output=True
)
software_list = process.stdout.split('\n')
print(software_list)
Print gives me empty list: ['']
EDIT:
- compgen is bash command which lists all available commands, both built-ins and installed programs available in PATH
- I have compgen installed on my machine