#!/bin/bash
if [ -e *.txt ] then
rm *.txt
echo "removing previous files"
else
echo "files already deleted"
fi
I'm trying to remove all txt files in my current directory if I have more than 1 txt file I get an error. Not quite sure whats happening.