ksh command to rename all files with no extension

hi!

i want to rename all files with no extension with the extension DAT.

with this command ls |grep -v "\\." i can list files but i dont know how i am going to rename them..

so

i tried

 
FILE_LIST=ls |grep -v "\\." 
 
for TEST_FILE in ${FILE_LIST}
do
 
mv $TEST_FILE $TEST_FILE".DAT"
 
fi
done 
 

and its wrong..

PLEASE HELP!

$ ls -1 | grep -v "\." | awk '{print "mv "$0" "$0".DAT"}' | sh
1 Like

i have just tried it..:slight_smile:

Many Thanks!