add agm macro (as on Unix); also use \n instead of \r\n