Topic "Error while "call nohup command &""

Author Message
Mercury

Guest


When I try typing

> open somesession
> cd somedirectory
> call nohup somecommand &

WinScp outputs

> Searching for host...
> Connecting to host...
> Authenticating...
> Using username "someuser".
> Authenticating with pre-entered password.
> Authenticated.
> Starting the session...
> Reading remote directory...
> Session started.
> -sh: Syntax error: ";" unexpected
> Connection has been unexpectedly closed. Server sent command exit status 2.
> Session 'somesession' closed.
> No session.

The command DOES work in PuTTY. The reason is clearly "&" at the end of command.
What to do?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I guess you cannot use & without TTY.
See documentation for more details about limitation of terminal in WinSCP.
_________________
Martin Prikryl
Mercury

Guest


Well, how to circumvent this?
(I use WinSCP to start some task automatically, so I cannot use PuTTY)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Mercury wrote:
Well, how to circumvent this?
(I use WinSCP to start some task automatically, so I cannot use PuTTY)

Try plink from PuTTY package.
_________________
Martin Prikryl
Mercury

Guest


And what to do if I need to upload some file automatically and run some command (automatically, too)? Use two programs just for the sake of some "&"?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Mercury wrote:
And what to do if I need to upload some file automatically and run some command (automatically, too)? Use two programs just for the sake of some "&"?

What about not using the &?
_________________
Martin Prikryl
zac80

Guest


Martin, is there any way I can forward a command to the remote server such that WinSCP does not hang while the command is executed? Particularly, I would like to run the command "nohup ./file.bin &".
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
zac80 wrote:
Martin, is there any way I can forward a command to the remote server such that WinSCP does not hang while the command is executed? Particularly, I would like to run the command "nohup ./file.bin &".

You can workaround syntactical problem with & by invoking the command from child shell, like:
/bin/sh -c "nohup ./file.bin &"
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License