in reply to How to find out a compressed file inside a script ?

On the Unix command line, I tend to use 'file':

file *.zip applepie.zip: ZIP archive keylime.zip: ZIP archive

Which is pretty much the same technique (relying on a magic number) as moritz and Bloodnok are advocating.