home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / LINUX / ARCHIVE / STRIPPER.Z / STRIPPER / sbin / stripper
Encoding:
Text File  |  1993-01-01  |  512 b   |  20 lines

  1. #!/bin/sh
  2. #
  3. # stripper - strip executables in your ~/bin directory
  4.  
  5. skipug="! -perm -4000 ! -perm -2000"  # SKIP SETUID, SETGID FILES
  6.  
  7. # find all executable files that aren't setuid or setgid
  8. find $HOME/bin -type f \( -perm -0100 $skipug \) -print |
  9.  
  10. # get a description of each file
  11. xargs file |
  12.  
  13. # skip shell scripts and other files that can't be stripped
  14. # by searching for non stripped executable files
  15. sed -n '/executable .*not stripped/s/:    .*//p' |
  16.  
  17. # Pipe what's left to the strip command
  18. xargs -t strip
  19.  
  20.