This works:

if [ -n ${ld_path} ]; then
   export ${ld_path}
fi

My Debian box uses Dash, and I think [[ is Bash-specific.