command to cat all *.dat files except ones modified today.

Title kind of says it all.  I need to execute the concatenate command against all .dat files in the directory except those that have been modified today.  So today is 12/09/11, this means the command should concatenate all except the last one in the list below.

$ ls -ltr *.dat
-rw-r--r-- 1 initiate initgrp  136 Nov 18 15:07 input-20111118-1507.dat
-rw-r--r-- 1 initiate initgrp  180 Nov 18 16:17 input-20111118-1617.dat
-rw-r--r-- 1 initiate initgrp   80 Nov 18 16:26 input-20111118-1626.dat
-rw-r--r-- 1 initiate initgrp  121 Nov 18 16:43 input-20111118-1643.dat
-rw-r--r-- 1 initiate initgrp 1079 Nov 18 17:50 input-20111118-1734.dat
-rw-r--r-- 1 initiate initgrp  602 Dec  7 12:02 input-20111207-1202.dat
-rw-r--r-- 1 initiate initgrp  173 Dec  7 12:21 input-20111207-1221.dat
-rw-r--r-- 1 initiate initgrp  348 Dec  9 14:53 input-20111209-1256.dat
donnatroniousAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

donnatroniousAuthor Commented:
Forgot to mention I'm using korn shell on RHLE 5.5 :-)
0
xtermCommented:
This should work.  Let me know if you want to do more than that.
find . -type f -name "*.dat" -mtime 1 | xargs cat

Open in new window

0
xtermCommented:
You can replace "." in the command with /path/to/files if you're running it from somewhere other than the directory containing the files.
0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

xtermCommented:
Yikes, I should learn to read.  I didn't see the "except" today.  Here, do this instead.  The +1 says to only search for files modified more than 1 day ago.
find /path/to/files -type f -name "*.dat" -mtime +1 | xargs cat

Open in new window

0
Kamaraj SubramanianApplication Support AnalystCommented:
find /path -type f -name "*.dat" -mtime +1 | while read file; do cat $file >> /tmp/output.txt; done

Open in new window

0
donnatroniousAuthor Commented:
xterm,

This works,

find /path/to/files -type f -name "*.dat" -mtime +1 | xargs cat

except its putting the last file modified first in the output.  It should cat them in the same order that a ls -l displays them.

Thanks in advance.
0
xtermCommented:
hmm, try this:
ls -ltra `find . -type f -name "*.php"` | awk '{print $9}' | xargs cat

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.