Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

gsc52

Using Session to Start a Background Process using Ampersand &

This may have already been discussed. But does WinSCP still not support starting processes in the background on Linux server through SSH. Runs all other commands fine.

Code Snippet
using (var session = new WinSCP.Session())
{
    // Connect
    session.Open(sessionOptions);                   
    string cmd =  "./go.sh &";
    var res = session.ExecuteCommand(cmd);
    if (!res.IsSuccess)
        throw new Exception($"Unable to Execute Start Command {cmd} ERROR:{res.ErrorOutput}");
    }
}

Is there a possible workaround for this?

-bash: line 9: syntax error near unexpected token `;'
-bash: line 9: `./go.sh & ; echo "WinSCP: this is end-of-file:$?"'