Topic "UNIX machine and special character &"

Author Message
solyman
[View user's profile]

Joined: 2011-08-26
Posts: 3
Location: alexandria
Dear Winscp support

I am using WinSCP.com file to got the command line and open ftp session for my UNIX server

when I try to use the order "call" to send and Executes arbitrary remote command I face a certain problem which is

when I type the command
------------------------------------
winscp > call /usr/Systems/script/mmlmacro -f /home/alarm/alarm.mjs

-------------------------------------
the script run and every thing is ok


but when I type the command

------------------------------
winscp > call /usr/Systems/script/mmlmacro -f /home/alarm/alarm.mjs |&
---------------------------------

to execute the command in the background I got the following error message

ksh[5]: syntax error at line 7 : `newline or ;' unexpected

I think the error is duoto the spesial character & since the command

------------------------------------
winscp > call /usr/Systems/script/mmlmacro -f /home/alarm/alarm.mjs |at now
--------------------------------


the command works well

plz help me to solve my problem , I think the error in the way i enter the &(and symbole)

thank you in advance
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
I believe that & is not supported in non-interactive shells.
_________________
Martin Prikryl
solyman
[View user's profile]

Joined: 2011-08-26
Posts: 3
Location: alexandria
thank you prikryl

this mean it will not work !!!!!!!!
Guest




When you are trying to "background a process", I believe you are supposed to just use "&", but you are using "|&". I've never seen "piped to and" before. You normally use pipe when there is another command after the pipe, but just use "&" when you want to "background the process".

As prikryl said this may still not work in non-interactive shells, but I just thought I'd mention that the "|&" looks odd to me, so try it without the "|", just to make sure that don't work either.

You could also try to make mmlmacro background itself...or make a version that will background itself mmlmacro-bg.
solyman
[View user's profile]

Joined: 2011-08-26
Posts: 3
Location: alexandria
Dear

the problem in the "&" character not in the "|" character

first i tried the "&" and it did not work and i got an error message

so I tried different solution which is using the "|&" and it works in the shell directly but did not work using the call command of the winscp



Anonymous wrote:
When you are trying to "background a process", I believe you are supposed to just use "&", but you are using "|&". I've never seen "piped to and" before. You normally use pipe when there is another command after the pipe, but just use "&" when you want to "background the process".

As prikryl said this may still not work in non-interactive shells, but I just thought I'd mention that the "|&" looks odd to me, so try it without the "|", just to make sure that don't work either.

You could also try to make mmlmacro background itself...or make a version that will background itself mmlmacro-bg.
Very Happy Very Happy Very Happy
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