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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…