I want to do this:
Bash code:
grub --batch << EOF
root (hd0,1)
find /boot/grub/menu.lst
setup (hd0)
quit
EOF
Python Code:
subprocess.call('grub --batch << EOF', shell=True)
subprocess.call('root (hd0,1)', shell=True)
subprocess.call('find /boot/grub/menu.lst', shell=True)
subprocess.call('setup (hd0)', shell=True)
subprocess.call('quit', shell=True)
subprocess.call('EOF', shell=True)
But that does not work. Is anyone now an alternative way to solve this?
Thank you so much!
source
share