Ravi Sir's Cards › AWS
${v#pat} vs ${v%pat}
This comparison card contrasts ${v#pat} and ${v%pat}. ${v#pat} is described as cuts from the front. ${v%pat} is described as cuts from the end. The card pairs ${v#pat} with file name, strip prefix, and ${v%pat} with folder, drop extension.
Read card text
What this card says
Trim
${v#pat}
Cuts from the front.
${v%pat}
Cuts from the end.
Key points
Double it for longest.
Double it for longest.
Example
${path##*/}
Use when
File name, strip prefix.
Folder, drop extension.