#!/bin/sh test -z $1 && { echo "usage: hook [args]"; exit 0; } cmd=$1 shift test -d ~/hook.d/$cmd && { chmod +x ~/hook.d/$cmd/* find ~/hook.d/$cmd/ -type f -executable | while read hook; do $hook "$@" || true done } #test $BROWSER = 1 && {