mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-26 22:06:35 +01:00
27 lines
344 B
Text
27 lines
344 B
Text
|
#!/bin/sh
|
||
|
CACHE=$HOME/.dmenu_cache
|
||
|
IFS=:
|
||
|
|
||
|
uptodate() {
|
||
|
test -f "$CACHE" &&
|
||
|
for dir in $PATH
|
||
|
do
|
||
|
test ! $dir -nt "$CACHE" || return 1
|
||
|
done
|
||
|
}
|
||
|
|
||
|
if ! uptodate
|
||
|
then
|
||
|
for dir in $PATH
|
||
|
do
|
||
|
cd "$dir" &&
|
||
|
for file in *
|
||
|
do
|
||
|
test -x "$file" && echo "$file"
|
||
|
done
|
||
|
done | sort | uniq > "$CACHE".$$ &&
|
||
|
mv "$CACHE".$$ "$CACHE"
|
||
|
fi
|
||
|
|
||
|
cat "$CACHE"
|