File: gzip_trace

package info (click to toggle)
staden 2.0.0%2Bb11-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,584 kB
  • sloc: ansic: 240,605; tcl: 65,360; cpp: 12,854; makefile: 11,203; sh: 3,023; fortran: 2,033; perl: 63; awk: 46
file content (21 lines) | stat: -rwxr-xr-x 379 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
if [ $# -eq 0 ]
then
    echo "Usage: gzip_trace file1 ..."
    echo "eg, 'gzip_trace *.scf'"
    exit
fi

for i in ${@+"$@"}
do
    echo "Compressing $i"
    CheckIfZipped=`gzip -lv "$i" 2>&1 | egrep '^defla'`

    if [ -n  "$CheckIfZipped"  ]
    then
        echo $i is already zipped ... skipping
    else
        gzip -v < "$i" > .tmp && mv .tmp "$i"
    fi

done