Any ideas what is wrong with this code?
CLIENT_BUILD_DIR=\"~/Desktop/TempDir/\"
if [ ! -d $CLIENT_BUILD_DIR ]
then
{
mkdir $CLIENT_BUILD_DIR
}
f
The quotes prevent the expansion of ~.
Use:
CLIENT_BUILD_DIR=~/Desktop/TempDir/
if [ ! -d "$CLIENT_BUILD_DIR" ]
then mkdir "$CLIENT_BUILD_DIR"
fi
The ~
character is not reinterpret when used in a variable.
You can use CLIENT_BUILD_DIR="$HOME/Desktop/TempDir/"
instead.
mkdir ${CLIENT_BUILD_DIR}
will do. No directory will be created if it already exists.