def METHOD_NAME(self):
    ''' Generates the shell script launching the job. '''
    launch_cmd = self.get_launch_cmd()
    lines = [
        "#!/bin/sh",
        " (echo R > %s && date +'%s' > %s) &&" %(self.status_file,
                                                 TIME_FORMAT,
                                                 self.time_file),
        " (cd %s && %s && (echo D > %s; %s) || (echo E > %s; %s));" %\
            (self.jobdir, launch_cmd,  self.status_file, self.ifdone_cmd,
             self.status_file, self.iffail_cmd),
        " date +'%s' >> %s; " %(TIME_FORMAT, self.time_file),
        ]
    script = '\n'.join(lines)
    if not os.path.exists(self.jobdir):
        os.makedirs(self.jobdir)
    open(self.cmd_file, "w").write(script)