I am trying to write an ifif 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 ideasideas; I only want to run the script if there is a .txt in the directory.