diff --git a/job.go b/job.go index 398079a..36c18b6 100644 --- a/job.go +++ b/job.go @@ -452,9 +452,9 @@ func (j *Job) Run() bool { if j.Timeout > 0 { ctx, cancel := context.WithTimeout(context.Background(), time.Duration(j.Timeout)*time.Second) defer cancel() - cmd = exec.CommandContext(ctx, j.cmd[0], j.cmd[1:]...) + cmd = exec.CommandContext(ctx, "bash", "-c", j.Command) } else { - cmd = exec.Command(j.cmd[0], j.cmd[1:]...) + cmd = exec.Command("bash", "-c", j.Command) } cmd.SysProcAttr = sysProcAttr