My code does not work. In the if
-statement it says "too many arguments". I know there are alternative ways to do this but I want to find out what is wrong with my code.
for fname in "*"
do
h=$fname
if [ -f $h ]
then
echo $fname
fi
done
read LOCATION
for filename in $LOCATION
do
if [[ -d $filename ]]; then
echo "$filename /"
elif [[ -f $PASSED ]]; then
echo "$filename *"
else
echo "$filename is not valid"
exit 1
fi
done