Hi:
I interpret you want to validate the output of the ls command a file at a time. Here's a ksh something with no error checking and the destination directory and ls hard-coded.
Careful, my readkey function returns only one character. You don't have to press enter.
Regards,
Ed
#!/bin/ksh
# this function returns only 1 character
function readkey {
local anykey oldstty
oldstty=`stty -g`
stty -icanon -echo min 1 time 0
anykey=`dd bs=1 count=1 <&0 2>/dev/null`
stty $oldstty
echo $anykey
} # end read_key
destdir=../prod
for filename in `ls *.htm`
do
echo $filename
echo "copy $filename to $destdir?"
anychar=$(readkey)
if [[ $anychar = 'Y' || $anychar = 'y' ]]
then
cp $filename $destdir
fi
done