10.3.8 isLowerStr (evaluates half-width lowercase character of the character string)
Syntax
isLowerStr character-string
Description
This command evaluates whether all character string specified for argument consists of half-width lowercase characters.
This command outputs 1 in the following cases:
-
All characters are half-width lowercase characters
This command outputs 0.
-
Character string contains a letter that is not a half-width lowercase character
Arguments
- character-string
-
This command specifies the character string to be evaluated.
Output to the standard output
1 or 0.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
Not less than 1 |
Termination with an error |
Examples
isLowerStr abc # "1" is output. isLowerStr ABC # "0" is output. isLowerStr aBc # "0" is output. # Character string contains a letter that is not a half-width lowercase character, return 1. result=$(isLowerStr "$var1") if [[ $result -eq 0 ]]; then return 1 fi