expansion
Bash Remove shortest suffix
Removes the shortest matching trailing segment.
Formal Syntax & Structure
bash syntaxbash
${p%pattern}Return Value
shell expansion result
Removes the shortest matching trailing segment.
Working Example
Example Snippetbash
p=a.b.cprintf '%s\n' "${p%.*}"