Запускать встроенные команды BASH в Python?

Есть ли способ запустить встроенные команды BASH из Python?

Я пробовал:

subprocess.Popen(['bash','history'],shell=True, stdout=PIPE)

subprocess.Popen('history', shell=True, executable = "/bin/bash", stdout=subprocess.PIPE)

os.system('history')

и многие их варианты. Я хотел бы запустить history или fc -ln .

18
задан the Tin Man 13 September 2012 в 17:48
поделиться