[Code Example] String to Uppercase using bash script

Total
0
Shares

In this article I will provide you code to convert your strings to all caps or uppercase using bash script. All caps strings are use in headings, titles, banners, posters etc. where a clear attention of customers is required. You can use our code example directly in your projects.

Code Example –

#!/bin/bash

upper() {
    echo "${1^^}"
}

upper "AN animAl is aN animal. DONKEY or DOG does NoT mAtTeR"

# Output:
# AN ANIMAL IS AN ANIMAL. DONKEY OR DOG DOES NOT MATTER

Inspired from Dylan Araps

Live Demo

Demo might not work in private window (incognito)

Sign Up for Our Newsletters

Get only the best articles delivered to your mail

You May Also Like

[Code Example] K Lists In Java

Table of Contents Hide IntroductionLet’s Dive In;klist CommandsCode ExampleResultsRelated Posts: Introduction K-list method displays the entries in the local credentials cache and key table in the command line of the…
View Post