News for hackers. Stuff that matters.
Re:The $5000 Compression Challenge by DougBTX on Tuesday March 10, 2015 @09:59AM (#9177731)
Here's the script:

    #!/bin/sh
    i=0
    f=`head -1 $1`
    n=`tail -1 $1`
    rm -f $f
    while [ $i != $n ]; do
        cat $1.$i >> $f
        i=`expr $i + 1`
        if [ $i != $n ]; then printf "5" >> $f; fi
    done
The iteration is done with a while loop based on metatdata from the "compressed" file (the number of parts, $n) and the name of the archive ($1). The order of the parts is determined by incrementing $i up to $n, not from eg, the order of the files in the file system, which seems to be what was implied in the comment earlier.

There are no comments on this comment yet.