The awk extraction and reporting language provides the toupper and tolower functions for converting strings to uppercase or to lowercase:
tolower(STRING)
The tolower function returns a lowercase version of the STRING argument. This function converts all letters to lowercase in the returned string. Only the returned string is converted, the provided argument remains unchanged:
BEGIN {
mystring = "I Like Apples"
print (tolower(mystring))
print mystring
}
toupper(STRING)
The toupper function returns a lowercase version of the STRING argument. This function converts all letters to uppercase in the returned string. Only the returned string is converted, the provided argument remains unchanged:
BEGIN {
mystring = "I Like AppLes"
print (toupper(mystring))
print mystring
}
These function are affected by the following locale environment variable settings.