Capitalize in Awk

Published on 06 April 2025 (Updated: 06 April 2025)

Welcome to the Capitalize in Awk page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

function usage() {
    print "Usage: please provide a string"
    exit(1)
}

function capitalize(s) {
    return toupper(substr(s, 1, 1)) substr(s, 2)
}

BEGIN {
    if (ARGC < 2 || !ARGV[1]) {
        usage()
    }

    print capitalize(ARGV[1])
}

Capitalize in Awk was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.