True. You have to work it around by using something like:
echo "sleep 1000 &" > /tmp/sleep_on_background.sh ; bash /tmp/sleep_on_background.sh
Hi Prikryl.
Thanks for the answer.
I tried to run the command on backround but got an error:
for the code:
CommandExecutionResult cmdExResult;
cmdExResult = curSession.ExecuteCommand("sleep 10000 &");
cmdExResult.outpot is:
"-bash: line 40: syntax error near unexpected token `;'\n-bash: line 40: `sleep 10000 & ; echo \"WinSCP: this is end-of-file:$?\"'"
can you please advise?
Thanks
On a typical *nix server, you can run a command on a background using &
operator, to avoid blocking the shell.
E.g.: session.ExecuteCommand("sleep 1000 &").Check();
Hi,
I am using .NET assembly with csharp.
I send command to remote server with ExecuteCommand method.
this command at the remote server does not stop alone but only with CTL C
so in my c sharp code - ExecuteCommand method dose not return and cpu is stuck in this line.
is there any way to ecutes command on the remote server with no waiting to the remote server output?
do you have an idea how can I solve this issue?
thanks alot