![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to achieve Synchronization operation between two shells. | cskumar | HP-UX | 6 | 3 Weeks Ago 08:18 AM |
| Do i need a script to achieve this? | new2ss | UNIX for Dummies Questions & Answers | 1 | 01-03-2008 03:07 AM |
| how to achieve following parallel processing thru unix | manas_ranjan | Shell Programming and Scripting | 3 | 09-04-2007 04:54 AM |
| mv and compress on the fly | simquest | UNIX for Dummies Questions & Answers | 1 | 02-22-2007 09:51 AM |
| tar and compress | muru | UNIX for Advanced & Expert Users | 4 | 07-31-2006 05:23 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm trying to figure out how I can get an equivalent output to a text file such as if I use
gunzip -l filename in that gunzip will output the previous file size and the compressed size and the ratio... is there a way to achieve this with compress and zip? i am very new at shell scripting and i seem to be getting documentation eyes but little result... if anyone could offer a bit of quick advice I would greatly appreciate it, thanks. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
at the moment I have this piece of code...
gzip helpme gunzip -l helpme > file gunzip helpme compress helpme gunzip -l helpme >> file gunzip helpme zip helpme zip helpme.zip helpme gunzip -l helpme.zip >> file gunzip helpme.zip as you can see I am simply compressing and decompressing this helpme file three times - gzip, compress and zip - and am trying to get their respective before and after and compression percentage for comparison. I'll use awk later to display it. So my question is really how do I get over the fact that gunzip -l outputs non gzip files as uncompressed -1 and ratio 0.0%? If anyone could steer me on course with this I would greatly appreciate it. I'm determined to get on top of this and just have the feeling I'm missing something. |
|
#3
|
|||
|
|||
|
If you are trying to compress an already compressed file you don't gain much, in fact it is possible to lose - in the sense that the compressed compressed file is larger than the compressed file.
try gzip -9 <filename> to get maximum compression. If you are trying archive a bunch of files, tar them first, then compress the tarball. tar will allow you to archive .gz files. |
|
#4
|
|||
|
|||
|
sorry I must not have explained properly... all I am trying to do at this point is compress using 3 ways... zip, gzip and compress... and output the results into a file for comparison... which I will use awk to output the results sorted by best compression...
... a single file only this is just an exercise and I'm not looking for code but rather general advice on how to go about it thanks for the response anyway Last edited by nortypig; 08-19-2006 at 03:54 PM. |
|||
| Google The UNIX and Linux Forums |