March 2018
Beginner to intermediate
416 pages
9h 24m
English
AWK has two functions for converting the case of the characters of a string. These functions are called tolower() and toupper(). The tolower() function takes a single string as an argument and returns a copy of that string, with all the uppercase characters converted to lowercase. The nonalphabetic characters are left unchanged. The following example illustrates the usage of the tolower() function:
$ vi tolower1.awkBEGIN { str = "Linux is derived from Unix. Unix is oldest OS." lower_case_str = tolower(str) print "Original String : ", str print "Lowercase String : ", lower_case_str}$ awk -f tolower1.awk
The output of the execution of the previous code is as follows:
Original String : Linux is derived from Unix. ...
Read now
Unlock full access