Shell script to get the latest file from the file list and move

Hi,

Anybody help me to write a Shell Script

Get the latest file from the file list based on created and then move to the target directory.

Tried with the following script: got error.

A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head -n1)
#if [ -n "$A" ] cp -u "$A" "$cveit/local_ftp/test/$(basename $A)"

got error invalid argument `-' to `-mtime'

Please help me to solve this.

Can you please post your script here?

This gives no clue!

Whatever $dateoffset expands into is the problem.

-mtime n

where n is one of a number n: n, +n, -n