Help with Shell Script

I need to copy multiple files from/to other directory, but i need to organize them by dates.
The command is like this:

cp -fp $(ls -gto --full-time | grep 2012-03-21 | cut -c 57-108) ../Destino/2012/03/21/

but i need to create repeat this command for each date, like this:

cp -fp $(ls -gto --full-time | grep 2012-03-19 | cut -c 57-108) ../Destino/2012/03/19/
cp -fp $(ls -gto --full-time | grep 2012-03-20 | cut -c 57-108) ../Destino/2012/03/20/
cp -fp $(ls -gto --full-time | grep 2012-03-21 | cut -c 57-108) ../Destino/2012/03/21/

i attempted to make a loop using for but doesn't worked, anyone have a suggestion?
all the files have the same extension, but their names are composed by random numbers, and this command has worked fine, my ideas has exhausted.
:wall:

And sorry for my poor English.

I am assuming you just want to copy files and not directories, try this

dt=`date '+%Y/%m/%d'`
mkdir -p ../Destino/$dt
cp -fp $(find . -mtime -1 -type f | awk -F "/" '{print $NF}') ../Destino/$dt

Please post a representative sample of ls -gto --fulltime .
Do any of your filenames contain space characters?

It's doesn't worked for me.

-bash-4.1$ ls -gto --full-time
total 92
-rwxrwxrwx. 1  8506 2012-03-22 11:59:35.343379200 -0300 33120330290688000152550000001426791634726526-nfe.xml
-rwxrwxrwx. 1  8635 2012-03-21 16:53:57.939979500 -0300 33120330290688000152550000001423161507994592-nfe.xml
-rwxrwxrwx. 1 10298 2012-03-21 15:50:39.661979500 -0300 33120330290688000152550000001423141008578203-nfe.xml
-rwxrwxrwx. 1 12357 2012-03-21 12:06:39.467400000 -0300 33120330290688000152550000001422941231160022-nfe.xml
-rwxrwxrwx. 1 11184 2012-03-20 10:22:58.387596900 -0300 33120330290688000152550000001419341011673085-nfe.xml
-rwxrwxrwx. 1  8482 2012-03-20 10:06:56.862996900 -0300 33120330290688000152550000001419331947121936-nfe.xml
-rwxrwxrwx. 1  7629 2012-03-19 16:11:18.646997000 -0300 33120330290688000152550000001416431560981105-nfe.xml
-rwxrwxrwx. 1  8133 2012-03-19 15:13:07.492397000 -0300 33120330290688000152550000001416381402258321-nfe.xml

-----

I need to copy the files according with they creation/modification date, the modification/creation time is the same for each file and never will change, for example, the file created on 2012-03-19, need to be copied to ../Destino/2012/03/19/, and i can copy the file with that command:

cp -fp $(ls -gto --full-time | grep 2012-03-21 | cut -c 57-108) ../Destino/2012/03/21/

I want to make one script like that:

var1=something
var2=something
for filename in *.xml
do cp -fp $(ls -gto --full-time | grep $var1 | cut -c 57-108) ../Destino/$var2
done

I don't have experience with Shell Script, and exhausted all of my ideas for solve that, i need this for my work or i will need to copy the files 1 by 1, alone :o :wall:

this may be not the best but it will do what you need. and adjust ../Destino/$fldr such that it's a valid absolute/relative path

ls -gto --full-time | awk -F " " '{print $4}' | sort | uniq | awk NF | while read dt 
    do
        cp_str=`ls -gto --full-time | grep $dt | awk -F " " '{print $NF}' | tr -s "\n" " "` 
        fldr=`echo $dt | sed s:-:/:g
        mkdir -p ../Destino/$fldr 2>/dev/null 
        cp $cp_str ../Destino/$fldr  2>/dev/null
    done