Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] test for *other* write permissions



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





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org