1 diff --git a/src/Slurm/BatchManager_Slurm.cxx b/src/Slurm/BatchManager_Slurm.cxx
2 index 1c7f8d7..a1e28ed 100644
3 --- a/src/Slurm/BatchManager_Slurm.cxx
4 +++ b/src/Slurm/BatchManager_Slurm.cxx
5 @@ -64,7 +64,7 @@ namespace Batch {
6 string cmdFile = buildCommandFile(job);
8 // define command to submit batch
9 - string subCommand = string("cd ") + workDir + "; sbatch " + cmdFile;
10 + string subCommand = string("bash -l -c \\\"cd ") + workDir + "; sbatch " + cmdFile + "\\\"";
11 string command = _protocol.getExecCommand(subCommand, _hostname, _username);
14 @@ -203,7 +203,7 @@ namespace Batch {
15 void BatchManager_Slurm::deleteJob(const JobId & jobid)
17 // define command to delete job
18 - string subCommand = "scancel " + jobid.getReference();
19 + string subCommand = string("bash -l -c \\\"scancel ") + jobid.getReference() + "\\\"";
20 string command = _protocol.getExecCommand(subCommand, _hostname, _username);
23 @@ -217,7 +217,7 @@ namespace Batch {
24 JobInfo BatchManager_Slurm::queryJob(const JobId & jobid)
26 // First try to query the job with "squeue" command
27 - string subCommand = "squeue -h -o %T -j " + jobid.getReference() + " 2>/dev/null";
28 + string subCommand = string("bash -l -c \\\"squeue -h -o %T -j ") + jobid.getReference() + " 2>/dev/null" + "\\\"";
29 string command = _protocol.getExecCommand(subCommand, _hostname, _username);
32 @@ -237,7 +237,7 @@ namespace Batch {
33 // If "squeue" failed, the job may be finished. In this case, try to query the job with
36 - string subCommand = "sacct -X -o State%-10 -n -j " + jobid.getReference();
37 + string subCommand = string("bash -l -c \\\"sacct -X -o State%-10 -n -j ") + jobid.getReference() + "\\\"";
38 string command = _protocol.getExecCommand(subCommand, _hostname, _username);