I am trying to check if an argument is a directory or a file. I want to put / after each directory name and * after each executable. I know ls uses -F to get this information, but I cannot figure it out in my script.
Here is my code:
echo -n "Please enter Directory name you wish to search: "
read dir
for filename in "/home/me/Desktop/$dir"/*
do
if (-F $filename)
then
echo $filename
fi
done
source
share