I need to write a Unix Shell script in such a way if .txt files exists in the path, it should return 0. If some other files exists it should return 1
I tried the below script but it is not working..
#!/bin/sh
cd /shz/abc_test/test/test_add/SourceFiles/test1/test01/test02/
chk_files()
{
if [ -e *.txt ]; then
echo "File Exists"
return 0
exit
else
echo "File doesn't exists"
return 1
exit
fi
return
}