expansion
Bash Replace trailing match
Restricts replacement to a match at the end.
Formal Syntax & Structure
bash syntaxbash
${p/%pattern/string}Return Value
shell expansion result
Restricts replacement to a match at the end.
Working Example
Example Snippetbash
p=a-aprintf '%s\n' "${p/%a/b}"