diff --git a/nipype/pipeline/plugins/base.py b/nipype/pipeline/plugins/base.py index 8949d36be3..becc6b4364 100644 --- a/nipype/pipeline/plugins/base.py +++ b/nipype/pipeline/plugins/base.py @@ -543,7 +543,9 @@ def _submit_job(self, node, updatehash=False): pyscript = create_pyscript(node, updatehash=updatehash) batch_dir, name = os.path.split(pyscript) name = ".".join(name.split(".")[:-1]) - batchscript = "\n".join((self._template, "%s %s" % (sys.executable, pyscript))) + batchscript = "\n".join( + (self._template.rstrip("\n"), "%s %s" % (sys.executable, pyscript)) + ) batchscriptfile = os.path.join(batch_dir, "batchscript_%s.sh" % name) with open(batchscriptfile, "wt") as fp: fp.writelines(batchscript)