How can I capture sftp session info from a shell script?

How can I capture sftp session info from a shell script?

Post by RK » Tue, 23 Aug 2005 23:47:32



Any help, please. I got to use sh output to capture from a sftp put
command the following lines:

...
sftp> put file1     100% 6846   105.1KB/s   00:00
sftp> exit

But when I use batch-mode transfer:


I got the following lines instead:

sftp> put file1
Uploading file1 to ...
sftp> exit

How can I capture the put progress info?

Thanks.

 
 
 

How can I capture sftp session info from a shell script?

Post by <nos.. » Wed, 24 Aug 2005 05:51:53


depends on sftp client - most utilities operating in BATCH mode
disable INTERACTIVE messages that will have no use other than to clog up the
target file...........

Smarten up your script to check return codes (errorlevels) to determine
success / failure
and branch accordingly.

IF  you have an intelligent reason for trying to do this, you may wish to
learn about
redirecting output of stderr, or look at the source if you determine that
stderr isn't
being used.  You could, of course, always modify and recompile the source to
change
the behavior of the tool.


> Any help, please. I got to use sh output to capture from a sftp put
> command the following lines:

> ...
> sftp> put file1     100% 6846   105.1KB/s   00:00
> sftp> exit

> But when I use batch-mode transfer:




 
 
 

1. Automating an sftp session in a script

How can I supply the password to sftp in a script or from a file? I reallize
I need to learn SSH better and hope to in the future.

But for now, I can interactively sftp to a certain host and supply the
password, but I can't script it. I have tried heredocs and the -b options,
but it still asks for the password interactively.

Thanks for any help.

Will Cardwell

2. Ultra-DMA hard-drives supported in Debian Linux?

3. how to capture standard output on telnet session script?

4. how do I add an rpm?

5. how to use sftp with a cronned shell script

6. 'netconfig' in RedHat???

7. Capture keystrokes in a Korn Shell script

8. Page fault in kernel mode

9. capturing CVS args in a shell script

10. Capturing keystokes in Korn Shell script

11. handling SIGINT in shell scripts when executing another shell script.

12. Nice Shell Script For Restricting Multiple Login Sessions

13. Q: How can I have a shell script call another shell script...