I'm trying to write a script to zip particular files with specific suffixes and different file types in a directory.  I see posts about zipping all files of particular extensions, but am hung up about how to only get certain files that have particular suffixes.Here is an example contents of directory:MCI_1003_4_FaMap.hdr    MCI_1003_4_RefB0.dat   MCI_1003_4_Tensor.imgMCI_1003_4_ColorMap0.hdr  MCI_1003_4_EgVec0.dat  MCI_1003_4_FaMap.img    MCI_1003_4_RefB0.hdr   MCI_1003_4_Trace.datMCI_1003_4_ColorMap0.img  MCI_1003_4_EgVec0.hdr  MCI_1003_4_MeanDwi.dat  MCI_1003_4_RefB0.img  MCI_1003_4_EgVal0.dat     MCI_1003_4_EgVec0.img  MCI_1003_4_MeanDwi.hdr  MCI_1003_4_Tensor.dat      MCI_1003_4_FaMap.dat   MCI_1003_4_MeanDwi.img  MCI_1003_4_Tensor.hdrI just want the following files to zip into something like DTI.zipMCI_1003_4_MeanDwi.hdr MCI_1003_4_MeanDwi.imgMCI_1003_4_Trace.datMCI_1003_4_RefB0.hdrMCI_1003_4_RefB0.imgThis is my unsuccessful attempt at a for loop:for i in * ; do zip -r DTI.zip *RefB0.hdr *RefB0.img *Tensor.dat *MeanDwi.hdr *MeanDwi.img $i; done
Help creating for loop to zip files with particular suffix and extension
shell script;zip