copying with a certain extension

trying to copy all the files without extension then add
"*.txt" but its not working is there any other way and i do not want to use
cpio -vdump just want to use copy command

FROM=/usr/share/doc
TO=/aleza/doc
#the follow function copies all the files without extensions
call(){

cd $FROM
find . ! -name "*.*" -type f | cpio -vdump /swepa/doc

}

#this func add the "*.txt" extension 
me(){

cd $TO
for i in * ; do
	        echo mv \"$i\" \"$i.txt\" | sh
	done

}
call
me

Try

find . "!" -name "*.*" -type f -exec cp {} "$TO"/{}.txt \;

why have u used -exec?

Or a move verbose one (like Carlo's):

find . \! -name "*.*" -type f | xargs -t -I {} cp "{}" "${TO}/{}.txt"

The difference is that it will print all cp commands executed! =o)

E.g.

# TO="./output"
# find . \! -name "*.*" -type f | xargs -t -I {} cp "{}" "${TO}/{}.txt"
cp ./2 ./output/./2.txt
cp ./1 ./output/./1.txt
cp ./3 ./output/./3.txt
cp ./4 ./output/./4.txt
# ls -lrt ./output/
total 0
-rw-rw-r--  1 jboss jboss 0 Oct 27 15:10 4.txt
-rw-rw-r--  1 jboss jboss 0 Oct 27 15:10 3.txt
-rw-rw-r--  1 jboss jboss 0 Oct 27 15:10 2.txt
-rw-rw-r--  1 jboss jboss 0 Oct 27 15:10 1.txt

As you can see, find will also print the path to the file in the output. To "solve" this, you can use the -printf option, but there is a problem, depending on your OS, this option will not be available:

# -printf arguments
# %h -> Path to the file
# %f -> Filename
find . \! -name "*.*" -type f -printf "cp %h/%f ${TO}/%f.txt\n" | sh