Fix issue#2: 'dev_idmacs not written to directory where idmacs.cmd is located', and consider GNU sleep in idmacs.cmd