As argv0 mentioned, $upper just makes it uppercase. If you wanted to check if it's uppercase or lowercase, you'd use isupper or islower. Note that these do treat numbers/symbols as uppercase or lowercase, but I don't really think that should be changed. It can be useful to check if everything other than symbols/numbers is upper or lower. And if you wanted to check if something is upper (or lower) and doesn't include numbers/symbols, it's easy enough to check for isalpha as well.