Remove quotes from string using bash script – Code Example


In this article I will provide you bash script code to remove quotes from string. This code will remove both single ' and double " quotes. It’s ready to use in your projects.

Code Example –


remove_quotes() {
    : "${1//\'}"
    echo "${_//\"}"

remove_quotes "I a'm 'n \"Animal\" lover"

# Output:
# I am n Animal lover

Inspired from Dylan Araps

Live Demo

Open Live Demo