I have Ubuntu 18.04 with ZSH installed. I have this bash script for checking if a directory exist.
Even though i have a directory called "~/.config", the condition is always negative. I can't seem to figure out what is wrong with my code.
setup.sh
#!/bin/bash
if [ -d "~/.config" ] ; then
echo "Directory exist"
else
echo "Does not exist"
fi
Made the file executable by using chmod +x ./setup.sh
output is always Does not exist