Can I echo in single quotes with a variable?
example
echo 'I love my $variable.';
I need to do this because I have lots of HTML to echo too.
Can I echo in single quotes with a variable?
example
echo 'I love my $variable.';
I need to do this because I have lots of HTML to echo too.
In my case, I have changed my command as follows and it worked for me:Added double quotes twice("") beside every single quote(')
PVALUE='1,2,3'
echo "variable='""${PVALUE},repmgr'""" >>postgresql.conf
Output:
variable='1,2,3,repmgr'
#How to print a variable in echo within a single quote bash shell script