#!/bin/shCACHE=$HOME/.dmenu_cacheIFS=: uptodate() { test ! -f $CACHE && return 1 for dir in $PATH do test $dir -nt $CACHE && return 1 done return 0} if ! uptodatethen for dir in $PATH do for file in "$dir"/* do test -x "$file" && echo "${file##*/}" done done | sort | uniq > $CACHE.$$ mv $CACHE.$$ $CACHEfi cat $CACHE