|
function list {
set zhaowj=$path;
echo "正在搜索 \"$zhaowj\".下的$zhaotype文件... 请骚候..."
for file in $zhaowj/*.$zhaotype $zhaowj/*/*.$zhaotype $zhaowj/*/*/*.$zhaotype $zhaowj/*/*/*/*.$zhaotype; do
if ! test -f "$file"; then continue; fi
regexp -s filename "$zhaowj/(.*)" "$file"
if [ -z "$havefile" ]; then set havefile="1"; fi
default=0;
menuentry "$file" --class $zhaotype {
action=open; file="${1}";file_type="$zhaotype"; export action; export file; export file_type; configfile $prefix/clean.sh;
#wimboot "${1}"
}
done
if [ -z "$havefile" ]; then
echo
echo "找不到文件!可能你放文件的目录嫩得太深!拜托把$zhaotype文件放在 \'$zhaowj\' 下先!"
echo
echo -n "按ESC继续 "
sleep -i -v 1
else
unset havefile
menuentry "继续搜索" --class search {
configfile $prefix/search.sh;
}
menuentry $"回菜单" --class go-previous {
set path=""; export path;
configfile $prefix/clean.sh;
#lua $prefix/main.lua;
}
fi
unset filename
}
前两年搞过这个文件搜索列成菜单的,好像就是用for,
|
|