I believe that scp does an isatty() on it's output and doesn't write the statistics unless it's being run from a terminal, and casual poking seems to confirm that's the case. You could use Expect or IPC::Run to run it with a pty and that should fool it into producing the statistitcs.
Of course it might be simpler to just save time before you start and again after the system( scp => ... ) returns, subtract and divide that into the file size (obtained with -s or stat.
In reply to Re: capture scp output
by Fletch
in thread capture scp output
by tomfoolry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |