1234567891011121314151617181920212223242526272829303132333435363738 |
- """Most bash-scripting is generated here.
- """
- BASH = '/bin/bash'
- BUG_avoid_Text_file_busy = True
- def write_sub_script(ofs, script):
-
-
-
-
- ofs.write('#!{}\n'.format(BASH))
- ofs.write('set -vex\n')
- ofs.write(script)
- if BUG_avoid_Text_file_busy:
- exe = BASH
- else:
-
-
-
-
-
-
-
-
- exe = ''
- return exe
- def write_script(script, script_fn, job_done_fn=None):
- if job_done_fn:
- script += '\ntouch {}\n'.format(job_done_fn)
- with open(script_fn, 'w') as ofs:
- exe = write_sub_script(ofs, script)
|