Mailinglist Archive: opensuse (3135 mails)

< Previous Next >
Re: [opensuse] shell script newbie: how to display progress of a pipe?
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Tue, 6 Mar 2007 03:14:04 +0100 (CET)
  • Message-id: <Pine.LNX.4.64.0703060310100.26500@xxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The Tuesday 2007-03-06 at 09:50 +0800, Zhang Weiwu wrote:

> Hello. I have a shell script that process about 35MB data: command1
> produce 35MB data and sed do some work to the data, send to command2 who
> receive these data:
> 
> $ command1 | sed -e 'xxxx' | command 2
> 
> The problem being I don't know the progress. Unfortunately both command1
> and command2 do not have any output of progress, maybe 'sed' has a way
> of displaying progress but I could not find. The commands run very long
> time (1 day) so I need a way to know how much data has been processed
> (1MB? 10MB?).

You can do something like this:

 command1 | tee file1 | sed -e 'xxxx' | tee file 2 | command 2

which will save intermediate results to file1 and file2, and from that you 
might be able to deduce progress.

- -- 
Cheers,
       Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFF7M5utTMYHG2NR9URAiWRAJ9KhU93DaxRZD9221lz8hhrUEY1dwCeK/Zm
ZMYG7yCvGb5mkjOkA70UnSg=
=ip+q
-----END PGP SIGNATURE-----

-- 
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
References