I am having problems getting a list of filenames that I want from a directory.
example: I have 3 files - filename.xxx.20110505.123030
filename.yyy.20110505.123030
filename.zzz.20110505.123030
There may be multiple xxx, yyy, or zzz files.
I want to be able to only pick up the xxx and zzz files. I tried this:
listxxx=`ls filename.xxx.201*.`
listzzz=`ls filename.zzz.201*.`
cat $listxxx $listzzz > filelist
But when I run it, it puts the contents of the files in filelist instead of just the filenames. I need a list of the filenames so I can do further processing.
I'm sure there's an easy way to do this, but it is escaping me.
Thanks for all advice.