1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-12-22 07:12:05 +02:00

pick-pdf add Version, add -type f to find, exit when no pdf file found

This commit is contained in:
Xiangfu Liu 2012-02-02 10:19:15 +08:00
parent 168c076e82
commit 441bd7e04b

View File

@ -5,14 +5,25 @@ export EXT=pdf
export i=0
echo " "
export PDF_PATH=~/
echo -e `basename $0` "\t\tVersion: 2012-02-02"
echo "Searching for *.$EXT files. It may take a while..."
echo " "
rm -f /tmp/fsel.tmp 2>/dev/null
touch /tmp/fsel.tmp
for aa in `find . -name "*.$EXT" -print` ;do i=`expr $i + 1` ; echo $i $aa >>/tmp/fsel.tmp ;done
for aa in `find ${PDF_PATH} -name "*.$EXT" -type f -print` ; do
i=`expr $i + 1` ;
echo $i $aa >>/tmp/fsel.tmp ;
done
export B=`cat /tmp/fsel.tmp`
if [ "$B" == "" ]; then
echo "No pdf file found"
exit
fi
export A=`dialog --menu "Select a File" 0 50 20 $B --stdout`
if test $A > 0