I have a script where I am trying to have a user enter the PATH to a command. And most of the time, this command is going to live in the user directory, so more often than not, the PATH will be entered using the ~ sign.
The code looks essentially like this (for simplicity of debugging):
echo -n "Enter PATH to start-site command and press [ENTER]: "
read startSite
cd $startSite
./start-site.sh $repositoryName $DIR/..
but I just get an error saying ~/my/path isn't a file or directory. If I copy and paste the command from the error into the terminal, it works fine.
Any ideas?