How to search for a directory with if clause?

Hello All,

I want to do a conditional search for a directory, i.e

pathname=/abc/def
foldername=xyz
if ( $pathname/$foldername/aaa )
then
..................
fi

Here i am searching for aaa directory inside the path and if it exist then it should go inside the loop.

Can anybody help me on this.

Thanks in advance.

pathname=/abc/def
foldername=xyz
if [ -d ${pathname}/${foldername}/aaa ]
then
	echo "dir exists"
fi