pattern substitution

The ${name/pattern/replacement} form, which replaces the first match of a glob pattern in a value, or every match with a double slash.

In more detail

Like trimming it uses glob patterns and runs inside bash, so it is faster than piping the value through sed for simple replacements. The variable itself is unchanged; only the expanded text differs.

Example

echo "${path//\//-}"

Related terms

Taught in

References