Is there a way for me to take a parameter then store it in a variable and use its value as non case sensitive?
Ex.
Lets say i have a parameter which contains "Hey".
Then im gonna store it to GR using
GR=$1
.
CL=/install/$GR.g
How can i make GR non case sensitive so that the script will use HEY.g in case Hey.g is not in the directory?
Thanks!
in KSH you can use typeset to set GR to lower or upper case.
typeset -u GR for uppercase or -l for lowercase.
Combine it with test to check whether the directory exists before running your code on it. (-d)
Can GR be mix of upper/lowercase letters aswell e.g can GR be Hey, HEy, hEy etc. ?
If so, it will complicate things a bit, but is doable with regex and custom shell functions.