#!/bin/csh # used by ~/bin/.csh/gzip_bins # Need to use "file" looking for "executable" as in: # /usr/bin/man: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, stripped # /usr/bin/man: setuid gzip compressed data, deflated, original filename, last modified: Wed Jun 9 17:32:46 1999, max compression, os: Unix # 'file' can produce any of these diagnostics, indicating do not compress: # a //usr/local/bin/wish8.0 -f script text # C shell script text # Bourne shell script text # setuid setgid Bourne shell script text # setuid a /usr/bin/suidperl script text /tmp/tools/file $1 | /tmp/tools/grep executable > /dev/null # To prove the above line returns 0 on an executable, & 1 for scripts, # extract this Makefile & run it. # test: # @echo "testing /usr/bin/file" # ./test_exec /usr/bin/file # @echo "/usr/bin/file is seen as an executable" # @echo "testing /etc/rc" # ./test_exec /etc/rc # @echo "/etc/rc is seen as an executable" # should never get this far