0

I have a bunch of files to process under the directory: /project/abc/outboud/, the file extension is .txt and .dat. How do I check different file extensions with a wildcard *?

My code:


DAT=/project/abc/outboud/*.dat
if [[ -f $DAT ]]; then echo "DAT files"; else echo "TXT files"; fi

code does not echo DAT files, any idea what I did wrong?

Liu Yu
  • 391
  • 1
  • 6
  • 16

0 Answers0