#!/bin/bash
v="some string.rtf"
v2=${v::-4}
echo "$v --> $v2"
Menghapus n karakter di awal
#!/bin/bash
v="some string.rtf"
v2=${v:4}
echo "$v --> $v2"
Sumber : https://stackoverflow.com/questions/27658675/how-to-remove-last-n-characters-from-a-string-in-bash