I want to locate directories that are upper, lower or have both upper and lower cases.
What I have is:
find /tmp/$var2 -type d' " ); [ -d $dir ] && echo "host case is incorrect" || echo "host case is correct"
This actually is part of a larger script and it does work but the problem is that it will report "case is correct" if the user enters an upper case directory and the upper case directory is there. If they enter lower case, and the lower case directory is there, it reports "case is correct." But what if both upper and lower case directories (for example, DAVID and david) exist?
I want to have the script say both upper and lower directories are there but I am not sure if I use [[:upper]] or if there is some test condition that will assist with this.
On the other hand, if there is only an upper case directory and no lower, I just want it to say "host case is correct."
Any assistance is appreciated. I have not much experience with test conditions and am not sure if I am on the right path.