diff options
author | Thomas White <taw@physics.org> | 2020-08-28 15:32:11 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-08-28 15:32:11 +0200 |
commit | 853660deb3fcd5cc87459853111dbdacdef0c033 (patch) | |
tree | bb21d850164a4ec763de3341acb8a8ba2367224c | |
parent | 6336f315f18e822d0b3acf59e1744c18d82463e9 (diff) |
Add hashbang to script
-rw-r--r-- | src/gui_backend_slurm.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui_backend_slurm.c b/src/gui_backend_slurm.c index 0334f00e..41049a56 100644 --- a/src/gui_backend_slurm.c +++ b/src/gui_backend_slurm.c @@ -104,6 +104,7 @@ static void *run_indexing(const char *job_title, char *workdir; struct stat s; char **cmdline; + char *cmdline_all; char *script; GFile *workdir_file; GFile *cwd_file; @@ -143,7 +144,14 @@ static void *run_indexing(const char *job_title, peak_search_params, indexing_params); - script = g_strjoinv(" ", cmdline); + cmdline_all = g_strjoinv(" ", cmdline); + + script = malloc(strlen(cmdline_all)+16); + if ( script == NULL ) return NULL; + + strcpy(script, "#!/bin/sh\n"); + strcat(script, cmdline_all); + g_free(cmdline_all); job = malloc(sizeof(struct slurm_job)); if ( job == NULL ) return NULL; |