Прочитайте man [ (или man test), и вы увидите, что вы можете сделать:
for theDir in path_name link_name ; do
if [ -L $theDir ] ; then
echo "$theDir exists and is a symbolic link"
elif [ -d $theDir ] ; then
echo "$theDir exists and is a directory"
fi
done
Я изменил порядок тестов, поэтому проверка каталога выполняется только в том случае, если $theDir не является ссылкой.