|
|
Use znew command in Terminal to recompress files
link is broken:
should be http://www.ugu.com
Use znew command in Terminal to recompress files
I did a quick test and you should be able to get away with the following:
Not quite so friendly as a command, but it get the job done quite nicely. Note that it will only work for single files. You might be able to handle multiple files using tar but I certainly wouldn't count on it.
jon
ditto
This script should do the trick:
#!/bin/sh
for file do
uncompress -c $file | gzip -c > ${file%%.Z}.gz
done
Now, the actual znew script is also just a Bourne shell script, so this really isn't saying much. The real znew script has error recovery, testing of output files, changes to compression level, etc.
I include my script here merely to show that there's no magic here. It's actually a fairly simple formula.
ditto
Bourne sh wouldn't do the pattern substitution though;
(but bash sh, ksh, zsh do do it) gzip -dc $file | gzip -c > ${file%%.Z}.gz || echo "ERROR -- Couldn't make '${file%%.Z}.gz'" |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|