I am trying to write an if statement in bash to test whether there are any files matching a certain pattern. If there is a text file in a directory it should run a given script.
My code currently
if [ -f /*.txt ]; then ./script fi
Please give some ideas I only want to run the script if there is a .txt in the directory.