Shell script – remove first and last quote (“) from a variable

Use tr to delete ":

 echo "$opt" | tr -d '"'

NOTE: This does not fully answer the question, removes all double quotes, not just leading and trailing. See other answers below.

Leave a Comment