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 –
#!/bin/bash
remove_quotes() {
: "${1//\'}"
echo "${_//\"}"
}
remove_quotes "I a'm 'n \"Animal\" lover"
# Output:
# I am n Animal lover