I am trying to create a script to compare an inputted string to an empty value. The logic works, but I keep receiving the following error:
./demo.sh: line 13: [[/var: No such file or directory
Here is the code block that I am struggling with:
read -p "Hello, please enter the target installation path: [/opt] " depl
echo "You have chosen to deploy in $depl"
echo "Now deploying in $depl..."
if [[$depl == ""]];
then
echo "Invalid input, cannot write to root!"
else
sleep 2
mkdir $depl/new
echo "Deployment complete!"
fi
I have tried adding my target inputs to $PATH which does not help. Everything else is working fine, but I am just not understanding why this error is being thrown. Any insight would be much appreciated!