I am generating html code using cshell, but i am having one problem while printing double quotes,
I need to write following code in file. where $var contains list of web address
<a href="$var">$var</a>
So i am using
echo "<a href="$var">$var</a>" > file.html
But with this " in href is not coming in file. Can any one please suggest me a way to do it. Is it possible to use anything else rather than " in echo command that can be used for variable interpolation also.
You can also use single quotes in the html string:
echo "<a href='$var'>$var</a>" > file.html
# or for the other string :
<a href='file:\\\\www.abc.com'>www.abc.com</a>
I Know it's not precisely what you asked for but it's correctly interpreted by the browsers.
What seems me strange is the backslashes. should the syntax not be :