pinosaur
/
dmenu.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge.
[dmenu.git]
/
dmenu_path
1
#!/bin/sh -f
2
CACHE=$HOME/.dmenu_cache
3
IFS=:
4
5
qfind() {
6
find "$@" 2>/dev/null
7
}
8
9
uptodate() {
10
test -f $CACHE &&
11
test "$(echo "$PATH")" = "$(sed 1q "$CACHE")" &&
12
qfind $PATH -maxdepth 0 -newer $CACHE
13
}
14
15
if ! uptodate
16
then
17
{
18
echo "$PATH"
19
qfind $PATH -type f -maxdepth 1 -perm -u+x -o -perm -g+x -o -perm -o+x |
20
sed 's,.*/,,' | sort | uniq
21
} > $CACHE.$pid
22
mv $CACHE.$pid $CACHE
23
fi
24
25
tail -n +2 $CACHE
26