I just studying in Bash Scripting. And have exercise that can't resolve. What is going wrong? Can you help me?
It should doing next: ThisThis script should copy all files of which the names are provided as arguments on the command line to the users home directory. If no files have been provided, the script should use read to ask for file names, and copy all file names provided in the answer to the users home directory.
if [ -z $1 ]
then
echo provide filenames
read $FILENAMES
else
FILENAMES="$@"
fi
echo the following filenames have been provided: $FILENAMES
for i in $FILENAMES
do
cp $i $HOME
done
If I provide arguments as string - it works. But if I provide as "read $FILENAMES" - it has not working.
Mentor shows same solution in his lessons but did not shows how it works.

Thank you for help.
UPDATE After I entered the filenames as arguments it gives empty strings and did not copy files to $HOME location
[dmytro@oc1726036122 ~]$ cd Desktop/
[dmytro@oc1726036122 Desktop]$ . totmp
provide filenames
one two
the following filenames have been provided:
the following filenames have been provided:
[dmytro@oc1726036122 Desktop]$