#!/bin/sh 
 for FILE in `find $1`; do 
    case `file ${FILE}` in 
       #*XML*)xmllint --noblanks ${FILE} > ${FILE}~ && mv -f ${FILE}~ ${FILE} || rm -f ${FILE}~ ;; 
       *PNG*)optipng -o7 ${FILE} &;; 
       *JPEG*)jpegtran -optimize -copy none ${FILE} > ${FILE}~ && mv -f ${FILE}~ ${FILE} || rm -f ${FILE}~ ;; 
       *"gzip compressed data"*)zcat ${FILE}|gzip -c9 > ${FILE}~ && mv -f ${FILE}~ ${FILE} || rm -f ${FILE}~ ;; 
       *"bzip2 compressed data"*)bzcat ${FILE}|bzip2 -c9 > ${FILE}~ && mv -f ${FILE}~ ${FILE} || rm -f ${FILE}~ ;; 
       *"xz compressed data"*)xzcat ${FILE}|xz -cze9 > ${FILE}~ && mv -f ${FILE}~ ${FILE} || rm -f ${FILE}~ ;; 
       *"ELF 32-bit LSB shared object"*) strip --strip-unneeded -R .note -R .comment ${FILE};; 
       *"ELF 32-bit LSB executable"*)[ "$(/lib/ld-linux.so.2 --list "$1" | grep -m1 'not a dynamic')" = "" ] && strip --strip-all -R .note -R .comment ${FILE};; 

       #*"Zip archive data"*)unzip ${FILE}; zip -9ym .....;;#TODO (zip doesnt do pipes and extracts to multiple dirs/files vs a single file) 
       *);; 
    esac 
 done 

 rdfind $1 
 defaulttexteditor results.txt 
 #DEV,DOC,#NLS? see new2dir 
 #static libs *"current ar archive"*