I want to escape double quotes in Bash. I followed the following approach:
#!/bin/bash
this is a \"number\"!
But is there another way?
I want to escape double quotes in Bash. I followed the following approach:
#!/bin/bash
this is a \"number\"!
But is there another way?
You can enclose the double quotes in single quotes:
echo '"'hola'"'
Or alternatively the whole text, including the double quotes:
echo '"hola"'
With GNU Bash:
echo -e "this is a \x22number\x22"
Output:
this is a "number"