I am trying to find out it a remote directory exists or not. However I just cannot manage to do it.
So far I tried the following
if [ ssh myUser@myHost '[ -d /home/targetDirectory ]' ] ; then
echo "Directory does exist"
fi
But I keep getting the error ssh binary operator expected. I dont see what am I doing wrong here.