Answers for "delete first and last characters from variable bash"

3

bash remove last character from string

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

echo $modified

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

bash remove first and last quotes

> echo '"quoted"' | xargs
quoted
Posted by: Guest on April-29-2021

Code answers related to "delete first and last characters from variable bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language