comparing timestamp of two files

Hi!

I need to copy a whole bunch of file from a build directory to my working directory. Many of these files already exist in my working directory. I need to copy only those files that have been modified since I last copied..

How do I compare the timestamp of two files, so that I would copy only the file if it is newer.

Thanks,
JP

if [ file1 -nt file2 ]
then
echo file1 is newer than file2
fi

You could also use the find command.
# find /blabla/*.txt -newer thisfile.txt
will only display files newer then thisfile.txt

/Peter