1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 13:41:53 +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 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 "Searching for *.$EXT files. It may take a while..."
echo " " echo " "
rm -f /tmp/fsel.tmp 2>/dev/null rm -f /tmp/fsel.tmp 2>/dev/null
touch /tmp/fsel.tmp 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` 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` export A=`dialog --menu "Select a File" 0 50 20 $B --stdout`
if test $A > 0 if test $A > 0