Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


ditto | 9 comments | Create New Account
Click here to return to the 'ditto' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
ditto
Authored by: SeanAhern on Apr 19, '04 02:41:53PM
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.

[ Reply to This | # ]

ditto
Authored by: LC on Apr 19, '04 05:32:42PM
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'"

[ Reply to This | # ]