Executable Binary File vs. Executable Script File

Executable Binary File vs. Executable Script File

Post by Young4er » Fri, 05 Nov 1999 04:00:00



Hi,

I need to write a simple script to "strip off" all the binary files in a
certain directory that contains some sort of executable script files,
i.e. perl, shell, tcl, etc.  I tried the following script that I named
"/tmp/junk":

        #!/bin/sh
        for ff in `find . -type f`
        do
                ! test -r $ff || strip $ff
        done

and it did stripped off the executable binary files as well as giving me
some error messages saying "File format not recognized" when it tried to
strip off the script files.  The question is: How to modify the above
script that will by pass the stripping process if the file is not really
an executable binary file?

Can anyone please help?  TIA.

--

PS> Remove the "4" from e-mail address to respond.

 
 
 

Executable Binary File vs. Executable Script File

Post by Tim Hocki » Fri, 05 Nov 1999 04:00:00


: and it did stripped off the executable binary files as well as giving me
: some error messages saying "File format not recognized" when it tried to
: strip off the script files.  The question is: How to modify the above
: script that will by pass the stripping process if the file is not really
: an executable binary file?

man file

--
Tim Hockin


This program has been brought to you by the language C and the number F.