I am getting a weird error, can't seem to figure out why.
Especially because it works in one place but not in another scenario.
I have his code that checks whether these directories exist - and the HOME dirs with ~ is failing in this code snippet:
if [[ ! -d "$valueToTest" ]]; then
echo 'Failed>>:'$valueToTest;
fi;
I get output:
Failed>>:~/.workspace/
Failed>>:~/.ssh
Failed>>:~/.workspace/vim/temp
Failed>>:~/.workspace/vim/backup
Failed>>:~/.workspace/vim
Failed>>:~/test
Like I said it happens ONLY with the ~ expansion to represent my HOME directory.
And this is the ONLY place this is happening as I have OTHER code that checks for path with ~ ie my HOME directory with ~ expansion, AND they work fine!
The directories are being read from value part of an associative array - but I can't see why that would be a problem. Also you can see the output has no quotes or such associated with it.
I have tried with and without double-quotes - no luck.
As in:
$valueToTest
${valueToTest}
"${valueToTest}"
Thank you for help.