use readlines to eliminate filehandle leaks
Use system instead of fork/exec
On grub 1, look in / and /boot before trying device.map (which is often
wrong)
Fix syntax error