Another hiccup in a script included in Wicked Cool Shell Scripts, one that’s a subtle problem because it sometimes occurs because of a user-set LS_OPTIONS flag. Script #37, bestcompress, has the following sequence:
smallest="$(ls -l "$name" $Zout $gzout $bzout | \
awk '{print $5"="NR}' | sort -n | cut -d= -f2 | head -1)"
In some situations this may always report that compress has the best compression.
To fix this, simply change the flag ‘-l’ to ‘-lf’ (that is, add the ‘-f’ flag) and it’ll all work as expected.
You can ascertain if that’ll fix the problem by just typing ls -l and ls -lf and compare the output.