What does ${NAME^^} do?

QuestionsQuestions8 SkillsProLinux Variable DeclaringAug, 29 2025
0111

The syntax ${NAME^^} is used in Bash to convert the value of the variable NAME to uppercase.

For example:

NAME="hello world"
echo "${NAME^^}"

This will output:

HELLO WORLD

The ^^ operator converts all lowercase letters in the variable to uppercase. If you want to convert only the first letter to uppercase, you can use ${NAME^} instead.

0 Comments

no data
Be the first to share your comment!