I need to echo some text. like text "hey"
If i try with code echo "text "hey""
getting output as text hey
So, how to display the double quotes also. Can anyone help me with this.
I need to echo some text. like text "hey"
If i try with code echo "text "hey""
getting output as text hey
So, how to display the double quotes also. Can anyone help me with this.
You can use
echo 'text "hey"'
or
echo "text \"hey\""
In short:
The double quote ( "quote" ) protects everything enclosed between two double quote marks except $, ', " and \. Use the double quotes when you want only variables and command substitution
The single quote ( 'quote' ) protects everything enclosed between two single quote marks. It is used to turn off the special meaning of all characters.
Further details: https://bash.cyberciti.biz/guide/Quoting