I have a variable var
in a Bash script holding a string, like:
echo $var
"some string.rtf"
I want to remove the last 4 characters of this string and assign the result to a new variable var2
, so that
echo $var2
"some string"
How can I do this?