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