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

Click here to return to the 'I've always used zip and unzip...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I've always used zip and unzip...
Authored by: HotFusionMan on Jan 05, '09 02:49:45PM

Thanks! Couldn't resist optimizing this one a bit, though. :)

zip -qr0 "$@" && unzip -aqo && rm

which does no compression and presumably will take less CPU time. Of course it requires more disk space....

I thought about factoring out the into a variable but am too rusty in sh/bash syntax and have already spent too much time skimming through the bash man page. :)

I also thought about generating a (hopefully)-guaranteed unique temp filename rather than using as is. I think you do that with $$ or similar.

[ Reply to This | # ]