#!/bin/bash 
 
if [ $# -gt 1 ]
then
   echo "USAGE:: ./str path or ./str"
   exit
fi

if [ "$1" != "" ]
then
   path=$1
else
   path="."
fi

for fname in `find $path -print` 
do 
   ftype=`file $fname | egrep "command|text|ascii|program|pcf85" | grep -v executable` 
   if [ "$ftype" != "" -a "$fname" != "./str" ] 
   then 
      chmod 755 $fname 
      cp $fname ./strtmp.$$ 
      sed "s/
//g" ./strtmp.$$ >$fname 
      cp $fname ./strtmp.$$ 
      sed "s///g" ./strtmp.$$ >$fname 
      rm ./strtmp.$$
      echo "stripped $fname";
   fi 
done   
