Описание тега parameter-expansion

Расширение параметров заменяет переменные их значениями на этапе оценки команды в большинстве оболочек, производных от Борна.

Parameter expansion is one of the series of transformations that commands go through when evaluated in a shell.

Its main function is to interpolate parameters, a.k.a. shell variables, but it also allows for some manipulation. For example, in bash, assuming variable var contains the string 1234abcd:

  • $var expands to 1234abcd
  • ${#var} expands to the parameter's length, 8
  • ${var%cd} expands to the parameter tail-trimmed of cd: 1234ab

Section parameter expansion from bash's Reference Manual