From xemacs-m  Thu Feb 13 09:16:27 1997
Received: from jagor.srce.hr (root@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id JAA29944
	for <xemacs-beta@xemacs.org>; Thu, 13 Feb 1997 09:16:16 -0600 (CST)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id JAA12725; Thu, 13 Feb 1997 09:20:51 +0100 (MET)
Sender: hniksic@public.srce.hr
To: xemacs-beta@xemacs.org
Subject: Re: compressed .el files
References: <Pine.SUN.3.95.970213001443.29872B-100000@bay1.bayserve.net>
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E
 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 13 Feb 1997 09:20:50 +0100
In-Reply-To: Jeff Miller's message of Thu, 13 Feb 1997 00:43:27 -0500 (EST)
Message-ID: <kig914tnml9.fsf@jagor.srce.hr>
Lines: 44
X-Mailer: Gnus v5.4.12/XEmacs 19.14

Jeff Miller <jmiller@bay1.bayserve.net> writes:

> ok, here is my stab at a script, though it's mostly lifted from Mark
> Borges example.  It was a bit cleaner than my first attempt.
> 
> #!/bin/sh
> 
> #
> #
> echo Compressing .el files in $1
> for i in `find $1 -type f -name \*.el -print`; do
>   [ -s ${i}c ] && echo  $i && gzip -f9 $i
> done
> echo Done

I don't think the `...` quotes are a good idea here -- you can have an
awful lot of output, and some systems have low limits on argv size.
IMHO a better approach is:

--cut
#! /bin/sh

#
#
echo Compressing .el files in "$1"
find "$1" -type f -name "*.el" -print | while read file
do
  [ -s "${file}c" ] && echo "$file" && gzip -f9 "$file"
done
echo Done
--cut

It should be equivalent, but using a pipeline instead of command
substitution.  It's probably somewhat faster too, as it doesn't wait
for `find' to finish before it starts working.

The quotes are added for good measure.  The script is untested, but
I'm quite positive that it should work.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
* Q: What is an experienced Emacs user?
* A: A person who wishes that the terminal had pedals.

