I am trying to loop through every file in a user specified directory. Here's my code:
clear
echo "enter the directory path: \n"
read directory
for file in $directory; do
echo $file
done
My input, e.g.: /home/user/Downloads
Output I get: /home/user/Downloads
If I use
clear
for file in *; do
echo $file
done
It works, but it shows only the contenets of current directory