Thanks for suggestions everyone. This is the best solution because it's clearly understandable and readable, doesn't have any external dependencies (like possibly unavailable or varying versions of perl/awk/sed/python/selinux)
Bash, apparently, can do octal arithmetic by using the 8# PERM=`stat -c '%a' /etc/resolv.conf` let OWRITABLE="8#$PERM & 8#002" let GWRITABLE="8#$PERM & 8#020" if [ $OWRITABLE -ne 0 -o $GWRITABLE -ne 0 ] ; then ... fi _______________________________________________ Discuss mailing list Discuss@blu.org http://lists.blu.org/mailman/listinfo/discuss