Source

dotfiles / fixperm.sh

#!/bin/sh

cd "$(dirname "$0")"

chmod go-rwx .
chmod -R go-rwx dot.*

# world-readable files
xargs chmod go+rX <<EOT
dot.bashrc
dot.bashrc.d
$(ls -d dot.bashrc.d/*)
dot.cshrc
dot.cshrc.d
$(ls -d dot.cshrc.d/*)
dot.emacs
dot.emacs.d
dot.emacs.d/lisp
$(ls -d dot.emacs.d/lisp/*)
dot.hgrc
dot.hgstyle
$(ls -d dot.hgstyle/*)
$(find dot.hgext)
dot.inputrc
dot.lessfilter
dot.login
dot.profile
$(ls dot.ssh/id_*.pub)
dot.subversion/config
dot.subversion/servers
dot.vimrc
dot.zshrc
dot.zsh
$(ls -d dot.zsh/*)
$(ls -d dot.zsh/*/*)
EOT

# world-enterable directory
xargs chmod go+X <<EOT
.
dot.subversion
EOT

# readonly files
xargs chmod ugo-w <<EOT
$(ls dot.ssh/id_*.pub)
EOT