I get a strange error, I can’t understand why.
Especially because it works in one place, but not in another scenario.
I have his code that checks if these directories exist - and the HOME dirs with ~ does not work in this piece of code:
if [[ ! -d "$valueToTest" ]]; then
echo 'Failed>>:'$valueToTest;
fi;
I get the output:
Failed>>:~/.workspace/
Failed>>:~/.ssh
Failed>>:~/.workspace/vim/temp
Failed>>:~/.workspace/vim/backup
Failed>>:~/.workspace/vim
Failed>>:~/test
As I said, this happens ONLY with the extension ~ to represent my HOME directory.
And this is ONLY the place where this happens, since I have OTHER code that checks the path with ~ ie my HOME directory with ~ extension, And they work great!
Directories are read from the value of part of the associative array, but I do not understand why this would be a problem. You can also see that there are no quotes or related links on the output.
- .
:
$valueToTest
${valueToTest}
"${valueToTest}"
.