I have a command that needs to take multiple input files, which are originally from one directory and have certain file name patterns. For example:
I have files:
A.dat B.dat C.dat readme.doc
I would like to learn how to pass all files with ending of ".dat" to this command, which then should look like:
command A.dat B.dat C.dat > /home/outputdir/output.dat
I could do it in python e.g. by storing the file names in a list, but how should I do it in shell please? Thanks a lot.