Using Session to Start a Background Process using Ampersand &

Advertisement

gsc52
Joined:
Posts:
1
Location:
USA

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:$?"'

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum