I'm trying to code a simple test for a directory, but keep running into a problem I've been unable to solve.
prompt> if [ -d "./mydir" ] then echo "yes"; fi
-bash: syntax error near unexpected token 'fi'
I've tried a variety of quotes, semi-colons, line-breaks, etc.
But always run into this syntax error.
Can you explain what I've done wrong here?