[Solved] Count characters of variable from right

My variable is something like:

f="/Volumes/VERVE/MOOTON_CALL/01_shots/XX/xx0195/Projects/program/rs0195_v400001.aep"  

I use ${f:63:6} to call "rs0195" as characters counted from the left, but it'd be so much easier to count from the right.

If ${f:95:10} counts from the left, what would count from the right?

Thanks

Given the length of f (${#f}), you can count back from the right:

$ echo ${f:${#f}-18:6}
rs0195
1 Like

That's it! Thanks!