Skip to content
The Bash Insectarium

/static/insetario/en/inseto/param-caixa/

Menu

BSH-012 · Parameters

${var^^}

Raises or lowers the case of the whole value — or just the first letter.

The caret lifts, the comma lowers: ${var^^} returns the value in uppercase, ${var,,} in lowercase. A single symbol — ${var^}, ${var,} — touches only the first letter.

It is a recent arrival: bash 4.0. In zsh the same case change lives in the flags ${(U)var} and ${(L)var}. To compare user input caselessly, ${resposta,,} normalizes before the case.

$ especie="Apis mellifera"
$ echo ${especie^^}
APIS MELLIFERA
$ echo ${especie,,}
apis mellifera
The same name, shouted and whispered.