Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2013 11:41:34 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Eduardo Morras <emorrasg@yahoo.es>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to know % of read file in cat?
Message-ID:  <20130309114134.eb42ba2f.freebsd@edvax.de>
In-Reply-To: <20130309105400.b181e12aa222502974715a1b@yahoo.es>
References:  <20130309105400.b181e12aa222502974715a1b@yahoo.es>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 9 Mar 2013 10:54:00 +0100, Eduardo Morras wrote:
> 
> Hello,
> 
> I use cat to read a file and pass it to another app, the command is this:
> 
> camibar% cat file.git | fossil import --git file.fossil
> 
> It takes a lot of time, file.git is 12GB, and i want to know if
> there's some 'magic' trick can I use to show me how many bytes
> or the % of the file.git cat sent to the other app.
> 
> Maybe cat isn't the correct tool?

Your example could be considered a "useless use of cat",
because you could have used the < redirection instead.
However, if the _actual_ program you're running, fossil,
has an option for a verbose output or progress indicator,
I would suggest using this (maybe "man fossil" lists
something like -v).

There are also tools that act on SIGINT or SIGINFO.
This signal can be sent by pressing Ctrl-T. Maybe fossil
also outputs a status message?

Offering a percentage of how much of a file has been read
would imply knowledge about the size of the file. The
construct cat | fossil does not provide fossil with that
information or even the file name in question. But obtaining
the amount of data processed should be possible somehow.


PS.
cat-less command: fossil import --git file.fossil < file.git


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130309114134.eb42ba2f.freebsd>