UNIX



1 : 2 # @(#) chkset v1.0 Check for set bits on Author: Russ Sage

4 FORM="-print" 5 SORT="sort"

7 if [ "`echo $1 | cut -c1`" = "-" ] 8 then case $1 in 9 -l) shift 10 FORM="-exec ls -ld {} ;" 11 SORT="sort +7";; 12 *) echo "usage: chkset [-l][file/dir ...]" >&2 13 exit 1;; 14 esac 15 fi

17 if [ "$#" -gt 0 ] 18 then SRC="$*" 19 else SRC="/" 20 fi

22 find $SRC \( -perm -4000 -o -perm -2000 \) $FORM | $SORT