Hi, I just wondering I done program which will list .jpg extension file but if there is not .jpg file in current directory display error how to do it ; here is my code
#!/bin/sh
echo "Enter a program function :" # declear User input
read func1 func2
## user must input list follow by .jpg eg list .jpg
if [[ -e '*.jpg' ] && [ $func2 = '.jpg']]
then
ls *.jpg # List the image file that are JPEG in Current Directory
else
echo " Error2, There is no jpg type in directory or incorrect function"
fi
Thank