From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121 invoked from network); 13 Jun 1998 19:40:35 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Jun 1998 19:40:35 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id PAA16619; Sat, 13 Jun 1998 15:13:17 -0400 (EDT) Resent-Date: Sat, 13 Jun 1998 15:11:32 -0400 (EDT) Message-ID: <19980613211233.A5224@math.fu-berlin.de> Date: Sat, 13 Jun 1998 21:12:33 +0200 From: Sven Guckes To: zsh-users@math.gatech.edu Cc: schaefer@brasslantern.com Subject: Re: lssum - summing up sizes of files Mail-Followup-To: zsh-users@math.gatech.edu, schaefer@brasslantern.com References: <19980613181013.A4302@math.fu-berlin.de> <980613100641.ZM27081@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.92.8i In-Reply-To: <980613100641.ZM27081@candle.brasslantern.com>; from Bart Schaefer on Sat, Jun 13, 1998 at 10:06:41AM -0700 X-Mailer-Info: http://www.math.fu-berlin.de/~guckes/mutt/ Resent-Message-ID: <"AVioy1.0.N24.YxiWr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1606 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Quoting Bart Schaefer (schaefer@brasslantern.com): > In 3.0, there's no direct way to read the size of the file into the shell. > You'd have to run "ls" and parse the output, or something. I see. Too bad. And I keep wondering why "gls" doesn't aloow to "sum file sizes". Doesn't everybody need this kind of thing every day? > in 3.1.4 with the "stat" module loaded, you can do it with > sumsizes() { > local sum sizes i > stat -A sizes +size $* > sum=0; for i in $sizes; ((sum += i)) > print sum > } > > E.g. > sumsizes **/*.o Looks cool! We have zsh-3.1.2 here - will that version work? Or is are "modules" a new feature of zsh-3.1.4? How do you "load" those modules, anyway? > The manual is woefully short of examples; it's > almost exclusively limited to descriptive text. Indeed - the manuals need more examples. Is there a good reason for not including them? (Other than "minimal size"?) Sven