#!/bin/shCACHE=$HOME/.dmenu_cacheUPTODATE=1IFS=: uptodate() { [ $UPTODATE -eq 1 ]; } if test ! -f $CACHE then UPTODATE=0fi if uptodatethen for dir in $PATH do test $dir -nt $CACHE && { UPTODATE=0; break; } donefi if ! uptodatethen for dir in $PATH do for file in "$dir"/* do test -x "$file" && echo "${file##*/}" done done | sort | uniq > $CACHEfi cat $CACHE