Answers for "bash remove the last character if it is match"

3

bash remove last character from string

country="portugal"
modified=${country::-3}

echo $modified

Output:
	"portu"
Posted by: Guest on October-04-2021

Code answers related to "bash remove the last character if it is match"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language