You can do like this (in bash v4 and higher):
#!/bin/bash
v="some string.rtf"
v2=${v::-4}
echo "$v --> $v2"
Note: macos uses bash 3.x by default
You can do like this (in bash v4 and higher):
#!/bin/bash
v="some string.rtf"
v2=${v::-4}
echo "$v --> $v2"
Note: macos uses bash 3.x by default