mardi 2 août 2016

How to check for specific file types in an if statement with bash shell

I want to know how I would go about looking for..let's say text files in a given directory. I want to iterate through all of the files in my directory, and for every text file, I want to convert it to a pdf file. Problem is, I do not know how to check whether a file is a text file within the parameters of an if statement in bash shell.

I set my ListOfFiles = ls -l and I iterate through with a for loop, i just need to know how to check for file types in an if statement.

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire