Les Mikesell wrote:
[snip]
Let the shell do the heavy lifting:
for file in *[^.gz]
do
gzip -c "$file" > "$file.gz"
done
But, it is generally easier to deal with things when you
separate them into subdirectories instead of having to
wild-card the filenames. Is there some reason to keep
the compressed and uncompressed versions in the same
directory?
Thank you... I will give that a try and see how it goes. :-)
This is actually part of a procmail script I'm developing....
I receive e-mail with attachments... (and certain criteria of course)
The procmail script sends them off via ftp to some other site. As the
files are ftp'd the local copies are erased.
Prior to ftp, I want to compress the files, but BOTH are to be sent to
the other site. (It would make sense to only send the gzip'd one and let
the receiving end expand it if it wants... but that is beyond my control.
By adding both files it will illustrate the dramatic effect on to things:
1 - the space required to keep these things in he first place
2 - the improved speed to d/l them later
Eventually, I expect to drop the original files all together, sending
only the gzip ones, in which case the script will be simplified because
gzip automatically *replaces* the original file.