tomfoolry has asked for the wisdom of the Perl Monks concerning the following question:
I have tried this: $scp_output = `/usr/bin/scp test_file.tar.gz usr@host:test_file.tar.gz`
But $scp_output remains empty. I have also tried piping the scp output into the perl script's stdin, but again without success.
# scp test_file.tar.gz usr@host:test_file.tar.gz | scp_capture.pl #!/usr/bin/perl while ($line = <STDIN>) { print $line; }
I even tried redirecting the output of scp to a file, so I could later read it into the script.
scp test_file.tar.gz usr@host:test_file.tar.gz > scp_output.txt
My guess is that my troubles are with the way scp generates its output to dynamically update the transfer speed/time. Is there any way I can capture this info?
Example scp output: test_file.tar.gz 100% 3884KB 3.8MB/s 00:00
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: capture scp output
by Limbic~Region (Chancellor) on Apr 20, 2005 at 17:27 UTC | |
by tomfoolry (Initiate) on Apr 20, 2005 at 17:47 UTC | |
|
Re: capture scp output
by Fletch (Bishop) on Apr 20, 2005 at 17:37 UTC | |
by tomfoolry (Initiate) on Apr 20, 2005 at 17:51 UTC | |
|
Re: capture scp output
by Anonymous Monk on Jul 18, 2013 at 16:27 UTC |