Operating System - OpenVMS
1748348 Members
5232 Online
108762 Solutions
New Discussion

Re: Redirecting output from sftp

 
SOLVED
Go to solution
Jörg Mohren
Advisor

Redirecting output from sftp

Hello everybody

I seem to have a problem similar to others already having posted here. I want to redirect the output of a SFTP command unter OpenVMS (SSH Secure Shell OpenVMS (V5.5) 3.2.0 on AlphServer ES40 - VMS 8.3).
For that I use:
> pipe (define/user sys$command nl: ; -
sftp "-B" x.cmd user@host) |copy sys$pipe: ls.out

where x.cmd is:
ls *.txt
exit

But the command never returns. When I do the commands interactively, the sftp ... alone works well, but when I call define /user sys$command nl: before, once again the sftp-command does not terminate.

Anybody got an idea where the problem might be?

Thanks a lot in advance

Jörg Mohren
5 REPLIES 5
Duncan Morris
Honored Contributor

Re: Redirecting output from sftp

Hello Jorg,

2 years since our initial discussion!

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1257512

When I answered that thread, I was using TCPIP V5.4 on Alpha VMS 7.3-2, but I no longer have those systems to hand.

I can confirm that the same problem exists with TCPIP Service 5.7 ECO1 on IA64 V8.3-1H1.

Whilst I cannot track down the exact sequence of events, I have found that the
"ls *.xxx"
hang is, in fact, a looping subprocess on the local side. It appears to be issuing massive amounts of i/o against nla0:.

I have also observed that a plain "ls" works perfectly well.

So, perhaps you could utilise this and change your command to:

pipe (def/user sys$command nl: ; sftp "-B" x.cmd user@host ) | -
sea sys$pipe ".txt"/out=ls.out


Duncan
John Gillings
Honored Contributor

Re: Redirecting output from sftp

Jörg,

What about:

$ pipe (define/user sys$command nl: ; -
sftp "-B" x.cmd user@host) > ls.out

or possibly:

$ DEFINE/USER SYS$COMMAND NL:
$ PIPE sftp "-B" x.cmd user@host > ls.out

Another redirection trick that might work

$ IF p1.EQS."REDIRECT"
$ THEN
$ 'p2'
$ 'p3'
$ 'p4'
$ 'p5'
$ 'p6'
$ 'p7'
$ 'p8'
$ EXIT
$ ENDIF
$ WRITE SYS$OUTPUT "Starting"
$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ @'self'/OUT=REDIR.OUT REDIRECT "DEFINE/USER SYS$COMMAND NL:" "sftp ""-B"" x.cmd user@host"
$ WRITE SYS$OUTPUT "Ending"
$ EXIT

(sorry, I don't have any nodes running sftp that I can test on)
A crucible of informative mistakes
RBrown_1
Trusted Contributor
Solution

Re: Redirecting output from sftp

And for that matter, why not

$ DEFINE/USER SYS$COMMAND NL:
$ DEFINE/USER SYS$OUTPUT ls.out
$ sftp "-B" x.cmd user@host

?

Jörg Mohren
Advisor

Re: Redirecting output from sftp

Hello

The solution of RBrown worked out well while the others did not terminate.
Thank you for your help.

Jörg
Jörg Mohren
Advisor

Re: Redirecting output from sftp

Closed until my next problem appears ...