From owner-freebsd-questions@FreeBSD.ORG Sat Mar 9 10:41:38 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32FF5886 for ; Sat, 9 Mar 2013 10:41:38 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id E324398B for ; Sat, 9 Mar 2013 10:41:37 +0000 (UTC) Received: from r56.edvax.de (port-92-195-26-8.dynamic.qsc.de [92.195.26.8]) by mx01.qsc.de (Postfix) with ESMTP id 980643D0E7; Sat, 9 Mar 2013 11:41:30 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r29AfYUC001928; Sat, 9 Mar 2013 11:41:34 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 9 Mar 2013 11:41:34 +0100 From: Polytropon To: Eduardo Morras 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> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 10:41:38 -0000 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, ...